Commit e4c4620e authored by Alexandre Delanoë's avatar Alexandre Delanoë

[Chart] Fix xAxis.

parent f92b652c
......@@ -126,7 +126,7 @@ yAxisVoid = yAxis
}
xAxis' :: Array String -> XAxis
xAxis' [] = unsafeCoerce {}
xAxis' [] = unsafeCoerce {show:false}
xAxis' xs = xAxis
{ "data": xData xs
, "type": "category"
......@@ -140,11 +140,12 @@ xAxis' xs = xAxis
-- TODO try to use Optional
yAxis' :: { position :: String
, show :: Boolean
, min :: Int
} -> YAxis
yAxis' {position, show} = yAxis
yAxis' {position, show, min} = yAxis
{ "type": "value"
, name: "data"
, min: 0
, min: min
, axisLabel: {formatter: "{value}"}
, position
, show
......
......@@ -26,7 +26,7 @@ endConfig = endConfig' V10
endConfig' :: ApiVersion -> EndConfig
endConfig' v = { front : frontRelative
, back : backDemo v }
, back : backLocal v }
-- , back : backDemo v }
------------------------------------------------------------------------
......
......@@ -62,7 +62,7 @@ chartOptions (HistoMetrics { dates: dates', count: count'}) = Options
{ mainTitle : "Histogram"
, subTitle : "Distribution of publications over time"
, xAxis : xAxis' dates'
, yAxis : yAxis' { position: "left", show: true }
, yAxis : yAxis' { position: "left", show: true, min:0}
, series : [seriesBarD1 {name: "Number of publication / year"} $ map (\n -> dataSerie {name: "", value: n, itemStyle : itemStyle {color:grey}}) count']
, addZoom : true
, tooltip : mkTooltip { formatter: templateFormatter "{b0}" }
......
......@@ -66,8 +66,8 @@ scatterOptions :: Array Metric -> Options
scatterOptions metrics = Options
{ mainTitle : "Ngrams Selection Metrics"
, subTitle : "Local metrics (Inc/Exc, Spe/Gen), Global metrics (TFICF maillage)"
, xAxis : xAxis { min: 0 }
, yAxis : yAxis' { position : "", show: true }
, xAxis : xAxis { min: -1 }
, yAxis : yAxis' { position : "", show: true, min : -2}
, series : map2series $ metric2map metrics
, addZoom : false
, tooltip : mkTooltip { formatter: templateFormatter "{b0}" }
......
......@@ -62,7 +62,7 @@ chartOptions (HistoMetrics { dates: dates', count: count'}) = Options
{ mainTitle : "Bar"
, subTitle : "Count of GraphTerm"
, xAxis : xAxis' dates'
, yAxis : yAxis' { position: "left", show: true }
, yAxis : yAxis' { position: "left", show: true, min:0}
, series : [seriesBarD1 {name: "Number of publication / year"} $ map (\n -> dataSerie {name: "", itemStyle: itemStyle {color:blue}, value: n }) count']
, addZoom : false
, tooltip : mkTooltip { formatter: templateFormatter "{b0}" }
......@@ -79,7 +79,7 @@ chartOptionsPie (HistoMetrics { dates: dates', count: count'}) = Options
{ mainTitle : "Pie"
, subTitle : "Distribution by GraphTerm"
, xAxis : xAxis' []
, yAxis : yAxis' { position: "", show: false }
, yAxis : yAxis' { position: "", show: false, min:0}
, series : [seriesPieD1 {name: "Data"} $ map (\(Tuple n v) -> dataSerie {name: n, value:v}) $ zip dates' count']
-- , series : [seriesBarD1 {name: "Number of publication / year"} $ map (\n -> dataSerie {name: "", value: n }) count']
, addZoom : false
......
......@@ -55,7 +55,7 @@ scatterOptions nodes = Options
{ mainTitle : "Tree"
, subTitle : "Tree Sub Title"
, xAxis : xAxis' []
, yAxis : yAxis' { position : "", show: false }
, yAxis : yAxis' { position : "", show: false, min:0}
, series : [ mkTree TreeMap nodes]
, addZoom : false
, tooltip : mkTooltip { formatter: templateFormatter "{b0}" }
......
......@@ -42,6 +42,7 @@ render dispatch _ state _ = [
, xAxis : xAxis' ["2015", "2016", "2017"]
, yAxis : yAxis' { position: "left"
, show: false
, min : 0
}
, series : myData
, addZoom : false
......@@ -63,7 +64,7 @@ naturePublis = Options
{ mainTitle : "Nature of publications"
, subTitle : "Distribution by type"
, xAxis : xAxis' []
, yAxis : yAxis' { position: "left", show: false }
, yAxis : yAxis' { position: "left", show: false, min:0}
, series : [seriesFunnelD1 { name: "Funnel Data" } naturePublis_y]
, addZoom : false
, tooltip : tooltipTriggerAxis -- Necessary?
......@@ -82,7 +83,7 @@ globalPublis = Options
{ mainTitle : "Histogram"
, subTitle : "Distribution of publications over time"
, xAxis : xAxis' (map show globalPublis_x)
, yAxis : yAxis' { position: "left", show: true }
, yAxis : yAxis' { position: "left", show: true, min:0}
, series : [seriesBarD1 {name: "Number of publication / year"} $ map (\n -> dataSerie {name: "", value: toNumber n }) globalPublis_y]
, addZoom : true
, tooltip : tooltipTriggerAxis -- Necessary?
......@@ -99,7 +100,7 @@ distriBySchool = Options
{ mainTitle : "School production in 2017"
, subTitle : "Distribution by school"
, xAxis : xAxis' []
, yAxis : yAxis' { position : "", show: false }
, yAxis : yAxis' { position : "", show: false, min:0}
, series : [ seriesPieD1 {name: "Pie data"} (map (\(Tuple n v) -> dataSerie {name: n, value: toNumber v}) distriBySchool_y)]
, addZoom : false
, tooltip : tooltipTriggerAxis -- Necessary?
......@@ -110,7 +111,7 @@ scatterEx = Options
{ mainTitle : "Scatter test"
, subTitle : "Scatter subtitle"
, xAxis : xAxis' []
, yAxis : yAxis' { position: "", show: true }
, yAxis : yAxis' { position: "", show: true, min:0}
, series : [ seriesScatterD2 {name: "name1", symbolSize: 10.0} (dataSerieV <$> [[2.0,3.0],[3.0,4.0]])
, seriesScatterD2 {name: "name2", symbolSize: 5.0 } (dataSerieV <$> [[1.0,3.0],[5.0,4.0]])
, seriesScatterD2 {name: "name3", symbolSize: 10.0} (dataSerieV <$> [[10.0,3.0],[8.0,4.0]])
......@@ -124,7 +125,7 @@ sankeyEx = Options
{ mainTitle : ""
, subTitle : ""
, xAxis : xAxis' []
, yAxis : yAxis' { position: "", show: false }
, yAxis : yAxis' { position: "", show: false, min:0}
, series :
[ seriesSankey
{ "data":
......@@ -193,7 +194,7 @@ treeMapEx = Options
{ mainTitle : ""
, subTitle : ""
, xAxis : xAxis' []
, yAxis : yAxis' { position: "", show: false }
, yAxis : yAxis' { position: "", show: false, min:0}
, series : [mkTree TreeMap treeData]
, addZoom : false
, tooltip : tooltipTriggerAxis -- Necessary?
......@@ -204,7 +205,7 @@ treeEx = Options
{ mainTitle : "Tree"
, subTitle : "Radial"
, xAxis : xAxis' []
, yAxis : yAxis' { position: "", show: false }
, yAxis : yAxis' { position: "", show: false, min:0}
, series : [mkTree TreeRadial treeData']
, addZoom : false
, tooltip : tooltipTriggerAxis -- Necessary?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment