Skip to content

Commit 13a3b95

Browse files
committed
Fix Bar trace tests
1 parent b227483 commit 13a3b95

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/Plotly.NET.Tests/HtmlCodegen/SimpleCharts.fs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,36 +78,36 @@ let ``Line and scatter plots`` =
7878
let columnChart =
7979
let values = [20; 14; 23;]
8080
let keys = ["Product A"; "Product B"; "Product C";]
81-
Chart.Column(keys = keys, values = values)
81+
Chart.Column(values, keys)
8282

8383
let barChart =
8484
let values = [20; 14; 23;]
8585
let keys = ["Product A"; "Product B"; "Product C";]
86-
Chart.Bar(keys = keys, values = values)
86+
Chart.Bar(values, keys)
8787

8888
let stackedBarChart =
8989
let values = [20; 14; 23;]
9090
let keys = ["Product A"; "Product B"; "Product C";]
9191
[
92-
Chart.StackedBar(keys = keys, values = values,Name="old");
93-
Chart.StackedBar(keys = keys, values = [8; 21; 13;],Name="new")
92+
Chart.StackedBar(values, keys, Name="old");
93+
Chart.StackedBar([8; 21; 13;], keys, Name="new")
9494
]
9595
|> Chart.combine
9696

9797
let stackedColumnChart =
9898
let values = [20; 14; 23;]
9999
let keys = ["Product A"; "Product B"; "Product C";]
100100
[
101-
Chart.StackedColumn(keys,values,Name="old");
102-
Chart.StackedColumn(keys,[8; 21; 13;],Name="new")
101+
Chart.StackedColumn(values,keys,Name="old");
102+
Chart.StackedColumn([8; 21; 13;],keys,Name="new")
103103
]
104104
|> Chart.combine
105105

106106
[<Tests>]
107107
let ``Bar and column charts`` =
108108
testList "SimpleCharts.Bar and column charts" [
109109
testCase "Column chart data" ( fun () ->
110-
"var data = [{\"type\":\"bar\",\"x\":[\"Product A\",\"Product B\",\"Product C\"],\"y\":[20,14,23],\"marker\":{}}];"
110+
"""var data = [{"type":"bar","x":["Product A","Product B","Product C"],"y":[20,14,23],"orientation":"v","marker":{}}];"""
111111
|> chartGeneratedContains columnChart
112112
);
113113
testCase "Column chart layout" ( fun () ->
@@ -121,15 +121,15 @@ let ``Bar and column charts`` =
121121
emptyLayout barChart
122122
);
123123
testCase "Stacked bar data" ( fun () ->
124-
"var data = [{\"type\":\"bar\",\"x\":[20,14,23],\"y\":[\"Product A\",\"Product B\",\"Product C\"],\"orientation\":\"h\",\"marker\":{},\"name\":\"old\"},{\"type\":\"bar\",\"x\":[8,21,13],\"y\":[\"Product A\",\"Product B\",\"Product C\"],\"orientation\":\"h\",\"marker\":{},\"name\":\"new\"}];"
124+
"""var data = [{"type":"bar","name":"old","x":[20,14,23],"y":["Product A","Product B","Product C"],"orientation":"h","marker":{}},{"type":"bar","name":"new","x":[8,21,13],"y":["Product A","Product B","Product C"],"orientation":"h","marker":{}}];"""
125125
|> chartGeneratedContains stackedBarChart
126126
);
127127
testCase "Stacked bar layout" ( fun () ->
128128
"var layout = {\"barmode\":\"stack\"};"
129129
|> chartGeneratedContains stackedColumnChart
130130
);
131131
testCase "Stacked column data" ( fun () ->
132-
"var data = [{\"type\":\"bar\",\"x\":[\"Product A\",\"Product B\",\"Product C\"],\"y\":[20,14,23],\"marker\":{},\"name\":\"old\"},{\"type\":\"bar\",\"x\":[\"Product A\",\"Product B\",\"Product C\"],\"y\":[8,21,13],\"marker\":{},\"name\":\"new\"}];"
132+
"""var data = [{"type":"bar","name":"old","x":["Product A","Product B","Product C"],"y":[20,14,23],"orientation":"v","marker":{}},{"type":"bar","name":"new","x":["Product A","Product B","Product C"],"y":[8,21,13],"orientation":"v","marker":{}}];"""
133133
|> chartGeneratedContains stackedColumnChart
134134
);
135135
testCase "Stacked column layout" ( fun () ->

0 commit comments

Comments
 (0)