lineColor: String

Sets the color of line for the entire series. This can be overridden at dataPoint level in order to customize the color of line connecting any two dataPoints. The value of lineColor can be a “HTML Color Name” or “hex” code.


Default: Automatically taken from dataSeries color.
Example: “blue”,”#21AB13″..

Notes
  • Color of the lineSegment is defined by the lineColor of first dataPoint
  • Applies only to all Line and Area charts.
  • When not set, lineColor for each dataSeries is chosen from the user defined color or from the default theme.


var  chart =  new  CanvasJS.Chart("container",
{
 .
 .
 data:[{
   lineColor: "red",
  },
 ]
 .
 .
});
chart.render();


Try it Yourself by Editing the Code below.

  Also See:    



In order to provide better support,we have closed the comments and switched completely to our Forums.
If you have any questions, please feel free to ask in our forums.

Comments 4

  1. Can you change line color on an if else? If line is below 0, color it red. If above 0, color it black?

    • Nef ron,

      Its not possible what exactly you are looking for, but you can change the lineColor based on dataPoint y-value. Here is a fiddle.

In order to provide better support,we have closed the comments and switched completely to our Forums.
If you have any questions, please feel free to ask in our forums.