WebChart type 'category' & OverrideOptions

I am trying to accomplish something like this with WebChart. I see that the example linked above is a ‘category’ type and I can not send in anything but doubles so I understand that wont work. However, I have been trying various ways of overriding the settings per this thread and this thread - many thatks to @AlbertoD , @Jeannot_Muller & @MarkusR for contributions to show their efforts, Im doing this trying to affect the Yaxes labels, min, max, steps and scale but Im having very little success so far.

Var injectionValueY As New jsonItem
Var injectionScaleY As New jsonItem
Var injectionValueX As New jsonItem
Var injectionTicksY As New jsonItem
Var injectionTicksX As New jsonItem
Var injectionScaleYaxes As New jsonItem
Var injectionyAxes As New jsonItem
Var injectionxAxes As New jsonItem
Var injectionScales As New jsonItem

injectionValueY.value("min") = 0
injectionValueY.value("max") = 1
injectionValueY.value("stepSize") = 1
injectionTicksY.value("ticks") = injectionValueY

injectionScaleY.value("stepped") = true
injectionScaleY.value("offset") = true
injectionScaleY.value("Labels") ="["+"on"+","+"off"+"]"
injectionScaleYaxes.value("scales")= injectionScaleY

injectionValueX.value("min") = me.xmin
injectionValueX.value("max") = me.xmax
injectionValueX.value("stepSize") = me.xstepsize
injectionTicksX.value("ticks") = injectionValueX


injectionyAxes.add( injectionTicksY )
injectionyAxes.add( injectionScaleYaxes )
injectionScales.value("yAxes") = injectionyAxes
injectionxAxes.add( injectionTicksX )
injectionScales.value("xAxes") = injectionxAxes

options.value("scales") = injectionScales

Can you share a sample project? Is easier for me to work with the code and see the results locally.
I’m no expert but I will try to help later today.

Thank you for looking @AlbertoD ! Heres the link to the GitHub repo

If I understand correctly you want to have ‘square’ lines. They are called steppedLines in ChartJS.

I looked at the docs here, and it looks like steppedLines is a property of the dataset and I can’t find a way to use the OverrideOptions to set that property.

Maybe @Greg_O can comment if there is something that can be done or if this is a feature that needs to be added to Xojo.

Thanks for your efforts! Ive been looking too and I cant find the Option that would do that. The other complication is that im not sure how else I can get it to make solid bars when I want the “on” condition (when the time gap shows seconds&on in the listbox) - and the also a way to scale it for different timeframes. I asked @Christian_Schmitz if his chart director will do it I will pop for that because either I roll it on my own or its a lot of digging into Chart.js…sob. It seems like it would be a very common need for people?

ChartDirector can do a step-line chart like in this picture:

  • A step-line chart where the data points are connected by steps instead of straight lines.

See also Visit Chart Gallery