Closed divq closed 3 months ago
@divq the issue is on the following statement:
CartesianLinearAxis yAxis = new CartesianLinearAxis(chart, ScaleId.create("Y"), AxisKind.Y);
Chart.js by default is using x
and y
as scale ids. In you code you are creating another scale (because you are using Y
uppercase) which is not used.
Try one the following solutions (in my opinion the best is the last one, by constant):
y
CartesianLinearAxis yAxis = new CartesianLinearAxis(chart, ScaleId.create("y"), AxisKind.Y);
string
CartesianLinearAxis yAxis = new CartesianLinearAxis(chart, "y", AxisKind.Y);
CartesianLinearAxis yAxis = new CartesianLinearAxis(chart, DefaultScaleId.Y);
Let me know if it is working.
@divq the issue is on the following statement:
CartesianLinearAxis yAxis = new CartesianLinearAxis(chart, ScaleId.create("Y"), AxisKind.Y);
Chart.js by default is using
x
andy
as scale ids. In you code you are creating another scale (because you are usingY
uppercase) which is not used.Try one the following solutions (in my opinion the best is the last one, by constant):
lowercase
y
CartesianLinearAxis yAxis = new CartesianLinearAxis(chart, ScaleId.create("y"), AxisKind.Y);
using constructor where scale id is a
string
CartesianLinearAxis yAxis = new CartesianLinearAxis(chart, "y", AxisKind.Y);
using scale id constant DefaultScaleId
CartesianLinearAxis yAxis = new CartesianLinearAxis(chart, DefaultScaleId.Y);
Let me know if it is working.
This works, thanks!
I used the following code to create a stacked bar chart, with two datasets and a time x axis and a number y axis, but the result chart has two y axis, and I do not know what went wrong.
Thanks for your help