Commit c69d4e81 authored by Mael NICOLAS's avatar Mael NICOLAS

Error, can't display the charts probably because of the types, i dont really

understand the js error (appear in the console)
parent 481a3225
...@@ -60,13 +60,13 @@ type OptsLoading = ...@@ -60,13 +60,13 @@ type OptsLoading =
type Option = type Option =
{ title :: Maybe Title { title :: Maybe Title
, legend :: Maybe Legend , legend :: Legend
, tooltip :: Maybe Tooltip , tooltip :: Tooltip
, grid :: Maybe Grid , grid :: Grid
, xAxis :: Maybe XAxis , xAxis :: XAxis
, yAxis :: Maybe YAxis , yAxis :: YAxis
, series :: Maybe (Array Series) , series :: Array Series
, dataZoom :: Maybe (Array DataZoom) , dataZoom :: Array DataZoom
} }
...@@ -135,7 +135,7 @@ type SubtextStyle = ...@@ -135,7 +135,7 @@ type SubtextStyle =
type Tooltip = type Tooltip =
{ trigger :: String { trigger :: String
, formatter :: String -- TODO function , formatter :: Maybe String -- TODO function
} }
type XAxis = type XAxis =
...@@ -429,23 +429,36 @@ yData1 = ...@@ -429,23 +429,36 @@ yData1 =
, axisLabel: {formatter: "{value}"} , axisLabel: {formatter: "{value}"}
} }
tooltip' :: Tooltip
tooltip' =
{
trigger: "axis"
, formatter: Nothing
}
series' :: Series
series' =
{
name: "All"
, "type": "bar"
, "data": [201, 222, 223, 777, 244, 255, 555, 879]
}
opt :: Option opt :: Option
opt = opt =
{ {
title: title' title: title'
,legend: Just legend' ,legend: legend'
,tooltip: tooltip' ,tooltip: tooltip'
,grid: grid' ,grid: grid'
,xAxis: Just xAxis' ,xAxis: xAxis'
,yAxis: Just yData1 ,yAxis: yData1
,series: series' ,series: [series']
,dataZoom: Just [dz1', dz1', dz2', dz2'] ,dataZoom: [dz1', dz1', dz2', dz2']
} }
where title' = Nothing where title' = Nothing
tooltip' = Nothing grid' = {containLabel: true}
grid' = Nothing
series' = Nothing
dataZoom' = Nothing
histogram2 :: R.ReactElement histogram2 :: R.ReactElement
histogram2 = echarts' opt histogram2 = echarts' opt
...@@ -455,7 +468,7 @@ histogram = echarts ...@@ -455,7 +468,7 @@ histogram = echarts
[ option [ option
[ tooltip [trigger "axis"] [ tooltip [trigger "axis"]
, grid [containLabel true] , grid [containLabel true]
, legend [data' ["Map terms coverage", "Favorites", "All"]] , legend [data' ["TEST MUDADA", "Favorites", "All"]]
-- , legend [data' ["Map Terms coverage", "Favorites", "All"]] -- , legend [data' ["Map Terms coverage", "Favorites", "All"]]
, xAxis , xAxis
[ type' "category" [ type' "category"
...@@ -467,7 +480,7 @@ histogram = echarts ...@@ -467,7 +480,7 @@ histogram = echarts
] ]
, dataZoom' [dz1', dz1', dz2', dz2'] , dataZoom' [dz1', dz1', dz2', dz2']
, yAxis [ya1, ya2] , yAxis [ya1, ya2]
, series [sd1, sd2, sd3] , series [ sd3]
] ]
] ]
......
...@@ -18,7 +18,7 @@ performAction :: forall eff props. PerformAction (dom :: DOM | eff) State props ...@@ -18,7 +18,7 @@ performAction :: forall eff props. PerformAction (dom :: DOM | eff) State props
performAction _ _ _ = pure unit performAction _ _ _ = pure unit
render :: forall props. Render State props Action render :: forall props. Render State props Action
render dispatch _ state _ = [text "Dashboard", histogram] render dispatch _ state _ = [text "Dashboard", histogram2]
layoutDashboard :: forall props eff. Spec (dom :: DOM | eff) State props Action layoutDashboard :: forall props eff. Spec (dom :: DOM | eff) State props Action
layoutDashboard = simpleSpec performAction render layoutDashboard = simpleSpec performAction render
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