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
240
Clearing a igDataChart
posted

Hi,

I am populating an HTML5 igDataChart that has 5 series which appears to be working fine.  Now I am attempting to Clear the chart of the data.  I tried using something like this:

$("#chart").igDataChart("notifyClearItem", currDataSource);

But does not work.

Here is how I create the data.  Every second I check for data and update.  That code sample is below:

data[data.length] = createNewChartItem(data[data.length - 1].Label + 1, v1, v2, v3, v4);

$("#chart").igDataChart("notifyInsertItem", dataSource, data.length - 1, data[data.length - 1]);


function createNewChartItem(label, newvalue1, newvalue2, newvalue3, newvalue4, newvalue5) {

 

return { Label: label, ValueArcStability: newvalue1, ValueOxygenFlow: newvalue2, ValueCarbonFlow: newvalue3, ValueKWH: newvalue4, ValueRoofOpen: newvalue5 };

}

My Chart HTML:

$("#chart").igDataChart({

width: "1500px",

height: "750px",

title: "Arc Stability",

// subtitle: "Five largest projected populations for 2015",

legend: { element: "legend" },

windowResponse: "immediate",

dataSource: currDataSource,

axes: [

{

name: "xAxis",

type: "categoryX",

title: "Sample Number",

label: "Label"

},

{

name: "yAxis",

type: "numericY",

minimumValue: 0,

maximumValue: 1000,

title: "Memory Share Value"

}

],

series: [

{

showTooltip: true,

name: "ArcStability",

type: "line",

title: "Arc Stability",

isHighlightingEnabled: true,

isTransitionInEnabled: true,

xAxis: "xAxis",

yAxis: "yAxis",

valueMemberPath: "ValueArcStability",

transitionDuration: 500,

thickness: 3.9,

brush: "orange"

}

,

{

showTooltip: true,

name: "OxygenFlow",

type: "line",

title: "Oxygen Flow",

isHighlightingEnabled: true,

isTransitionInEnabled: true,

xAxis: "xAxis",

yAxis: "yAxis",

valueMemberPath: "ValueOxygenFlow",

transitionDuration: 500,

thickness: 5.9,

brush: "purple"

}

,

{

showTooltip: true,

name: "CarbonFlow",

type: "line",

title: "Carbon Inj Sec.",

isHighlightingEnabled: true,

isTransitionInEnabled: true,

xAxis: "xAxis",

yAxis: "yAxis",

valueMemberPath: "ValueCarbonFlow",

transitionDuration: 500,

thickness: 1.9,

brush: "red"

}

,

{

showTooltip: true,

name: "KiloWatts",

type: "line",

title: "KWH",

isHighlightingEnabled: true,

isTransitionInEnabled: true,

xAxis: "xAxis",

yAxis: "yAxis",

valueMemberPath: "ValueKWH",

transitionDuration: 500,

thickness: 0.9,

brush: "green"

} ,

{

showTooltip: true,

name: "RoofOpen",

type: "line",

title: "Roof Open",

isHighlightingEnabled: true,

isTransitionInEnabled: true,

xAxis: "xAxis",

yAxis: "yAxis",

valueMemberPath: "ValueRoofOpen",

transitionDuration: 500,

thickness: 0.9,

brush: "black"

}],

});


Parents Reply Children