[CLOSED] How to Change the Stroke width of Line Series.

  1. #1

    [CLOSED] How to Change the Stroke width of Line Series.

    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.
    Last edited by fabricio.murta; Jul 13, 2021 at 1:47 AM.
  2. #2
    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' style LineWidth. 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!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Thanks.
    I am creating the series from code behind like this.

    var series2 = new LineSeries();
    chart.Series.Add(series2);
    series2.XField = NameBinding;
    series2.YField = new[] { "Max" };
    series2.ShowMarkers = true;
    series2.Highlight = true;
    Somehow cant find "Sprite" or LineWidth property anywhere.
    Last edited by fabricio.murta; Jul 10, 2021 at 3:37 AM. Reason: Wrap code in [code][/code] tags.
  4. #4
    Hello @Hrishi!

    If you take a look at the example we linked, you'll notice the LineWidth property is in the StyleSpec block. So what you want to complete the code snippet you shared is something like:

    series2.StyleSpec.Add(new Sprite() { LineWidth = 3 });
    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Works perfect!!
    Thanks a lot.
  6. #6
    Glad it helped, thanks for the feedback!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 3
    Last Post: Mar 12, 2014, 7:36 AM
  2. [CLOSED] Fill between two line series
    By jchau in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 20, 2014, 1:51 PM
  3. Replies: 2
    Last Post: Nov 07, 2013, 1:03 PM
  4. [CLOSED] Disable Line Series Tips
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 19, 2013, 4:12 PM
  5. How to use Line series Chart in version 1.3
    By Binai in forum 1.x Help
    Replies: 1
    Last Post: May 08, 2013, 12:46 PM

Tags for this Thread

Posting Permissions