Commit 9b39f1fb authored by Alexandre Delanoë's avatar Alexandre Delanoë

[CHART][SCATTER] fix data.

parent d00d8d64
......@@ -163,10 +163,11 @@ series sh name ss = { name: name
, "data": ss
}
seriesD2 :: Chart -> Number -> Array (Array Number) -> D2
seriesD2 sh size ds = { "symbolSize" : size
seriesD2 :: String -> Chart -> Number -> Array (Array Number) -> D2
seriesD2 n sh size ds = { "symbolSize" : size
, "data" : ds
, "type" : seriesType sh
, name : n
}
......
......@@ -59,7 +59,8 @@ type D1 =
-- | Scatter Dimension 2 data
type D2 =
{ "symbolSize" :: Number
{ name :: String
, "symbolSize" :: Number
, "data" :: Array (Array Number)
, "type" :: SeriesType
}
......
......@@ -108,9 +108,9 @@ scatterEx :: Options
scatterEx = Options { mainTitle : "Scatter test"
, subTitle : "Scatter subtitle"
, xAxis : xAxis []
, yAxis : [ SeriesD2 $ seriesD2 Scatter 10.0 [[2.0,3.0],[3.0,4.0]]
, SeriesD2 $ seriesD2 Scatter 5.0 [[1.0,3.0],[5.0,4.0]]
, SeriesD2 $ seriesD2 Scatter 10.0 [[10.0,3.0],[8.0,4.0]]
, yAxis : [ SeriesD2 $ seriesD2 "name1" Scatter 10.0 [[2.0,3.0],[3.0,4.0]]
, SeriesD2 $ seriesD2 "name2" Scatter 5.0 [[1.0,3.0],[5.0,4.0]]
, SeriesD2 $ seriesD2 "name3" Scatter 10.0 [[10.0,3.0],[8.0,4.0]]
]
, yAxisFormat : (YAxisFormat { position : ""
, visible : true
......
......@@ -75,9 +75,9 @@ scatterOptions ds = Options
--{-
map2series :: Map TermList (Array (Array Number)) -> Array Serie
map2series ms = map (\k -> maybe (toSeries [[]]) toSeries $ lookup k ms) ((Set.toUnfoldable $ keys ms) :: (Array TermList))
map2series ms = map (\k -> maybe (toSeries k [[]]) (toSeries k) $ lookup k ms) ((Set.toUnfoldable $ keys ms) :: (Array TermList))
where
toSeries xs = SeriesD2 $ seriesD2 Scatter 5.0 xs
toSeries k xs = SeriesD2 $ seriesD2 (show k) Scatter 5.0 xs
--}
getMetrics :: Path -> Aff Loaded
......
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