Changing Default Values
Could someone provide an example of how to change the defaults? I am trying to remove the point dots on the line chart but am not having any luck.
Here's my code: var lineChartData = { labels : ["Year","Week","Current"], datasets : [{ fillColor : "rgba(173,215,116,0.4)", strokeColor : "#4a9c45", pointColor : "rgba(220,220,220,1)", pointStrokeColor : "#fff", pointDot : false, data : [3,2.5,currentPrice] }] } var myLine = new Chart(document.getElementById("chart").getContext("2d")).Line(lineChartData);
To remove the point dots on the line, you need to pass in pointDot: false from another object, not as a property on lineChartData.
For example,
var lineChartData = {
labels : ["Year","Week","Current"],
datasets : [{
fillColor : "rgba(173,215,116,0.4)",
strokeColor : "#4a9c45",
pointColor : "rgba(220,220,220,1)",
pointStrokeColor : "#fff",
data : [2.5,3,4,5,10]
}]
};
var opts = { pointDot: false };
var myLine = new Chart(document.getElementById("chart").getContext("2d")).Line(lineChartData, opts);
mikemedora: Thanks for asking this question as I was puzzling over it as well. Having gone back and looked at the documentation, knowing the answer already, I can see that it was mentioned. However, it really seems like an example in the documentation is in order! Cheers, Will
I believe this is now documented on http://www.chartjs.org/docs/ search for pointDot
Recommending to close issue
Yep you can change default options globally or a chart typespecific level.
Docs here:http://www.chartjs.org/docs/#getting-started-global-chart-configuration