Hi.
I am creating a chart control from Code behind and adding Line Series. I searched everywhere but cannot find a way to change the stroke width of the Line series. I am using Ext.net 5.2 with Spotless Theme. Any help will be appreciated.
Printable View
Hi.
I am creating a chart control from Code behind and adding Line Series. I searched everywhere but cannot find a way to change the stroke width of the Line series. I am using Ext.net 5.2 with Spotless Theme. Any help will be appreciated.
Hello, @Hrishi!
The charts' theming is not really related to general theming, as confuse as it may sound. Charts uses different settings as they are composed as HTML Canvas sprite elements.
That said, you have specific properties that are not CSS to set up the looks of charts, including theming support. For the specific line series' stroke width, you'd want to change the line series' styleLineWidth
. A good example of that is in the bottom of the source code for this example:
- Charts > Line > Plot
I believe this is pretty much all you need. And browsing neighboring chart examples you will be able to see further customizations we done, including special renderers, gradients, and fills; so take your time, and I'm sure you'll be able to make the charts look just how you need them to!
Hope this helps!
Thanks.
I am creating the series from code behind like this.
Somehow cant find "Sprite" or LineWidth property anywhere.Code:var series2 = new LineSeries();
chart.Series.Add(series2);
series2.XField = NameBinding;
series2.YField = new[] { "Max" };
series2.ShowMarkers = true;
series2.Highlight = true;
Hello @Hrishi!
If you take a look at the example we linked, you'll notice theLineWidth
property is in theStyleSpec
block. So what you want to complete the code snippet you shared is something like:
Hope this helps!Code:series2.StyleSpec.Add(new Sprite() { LineWidth = 3 });
Works perfect!!
Thanks a lot.
Glad it helped, thanks for the feedback!