Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
975
setting the colour of a series
posted

how on earth do you set the colour of a series ? At the moment each series is assigned a diferent colour automatically but I want to set my own colour.  Its simply not clear how to do this really basic thing

Parents
No Data
Reply
  • 2575
    Suggested Answer
    Offline posted

    Hello Mark,

    Styling the Chart Series touch touches on this in the intro section; you'll need to set the brush property of the series. Looking at the brush documentation, you can find an example code snippet setting the series color to "blue". Below is the relevant snippet:

    $(".selector").igDataChart({
           axes: [{
               name: "xAxis",
               type: "categoryX",
               label: "Label"
           },
           {
               name: "yAxis",
               type: "numeric"
           }],
           series: [{
               name: "series1",
               title: "Sales",
               type: "column",
               xAxis: "xAxis",
               yAxis: "yAxis",
               valueMemberPath: "Value1",
               brush: "blue"
           }]
       });

    Please let me know if you have any further questions.
Children
No Data