jQuery UI Widgets › Forums › Chart › Clear chart
This topic contains 6 replies, has 3 voices, and was last updated by Peter Stoev 10 years, 2 months ago.
-
AuthorClear chart Posts
-
Hi,
Is there a function to clear chart?
Thanks and regards.
Hi Karen,
There is no built in function, but like a workaround you can set 0 for all values an then to update.
Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comHi Ivailo,
What do you mean 0 for all values?
Like this?
$('#jqxGraphViewProcessAlign').jqxChart({ source: 0, xAxis: { type: 0, baseUnit: 0, dataField: 0, valuesOnTicks: 0, unitInterval: 0, tickMarks: 0, axisSize:0, minValue: 0, maxValue: 0, labels: { angle: 30, horizontalAlignment: 'left', verticalAlignment: 'center', rotationPoint: 'left', offset: { y: -30 }, formatFunction: function(value) { return $.jqx.dataFormat.formatDate(value, 'dd-MMM-yyyy HH:ss'); } } } });Hi Karen,
Set your data source with 0 values.
Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comHi Ivailo,
When I set the source to an empty array, I get the following error:
Error: Invalid value for <rect> attribute y="NaN"Is there a cleaner way to clear the charts? An example would be a great help.
Thanks!
Hi Karen,
Set the valus of your data source like this.
var data = [{ a: 0, b: 0, c: ... }]Then update.
Here is a bit modified update demo for visualization.Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comHi Karen,
You can also try:
$('#chartContainer').jqxChart('seriesGroups', []);Best Regards,
Peter Stoev
jQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.