BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
ASP.NET:
<input type="button" id="1" value="Point 1" onclick="updatePoints(this.id)"/>
<input type="button" id="5" value="5 Points" onclick="updatePoints(this.id)" />
<input type="button" id="50" value="50 Points" onclick="updatePoints(this.id)" />
<input type="button" id="100" value="100 Points" onclick="updatePoints(this.id)" />
function updatePoints(id) {
var chart = $("#Chart1").ejChart("instance"),
//Get the points depends upon the input
data = getData(id),
chartArea = 40,
chartBounds = 60;
chart.model.series = [];
//Assign points to data source
chart.model.series.push({ dataSource: data, xName: "xValue", yName: "yValue" })
//Specify the size of chart with respect to length of data source
chart.model.size.height = chartBounds + (chartArea * parseInt(id));
chart.redraw();
}
function getData(count) {
var chartPoint = [];
for (var i = 1; i <= parseInt(count) ; i++) {
var y = Math.random() * 1 + 0;
chartPoint.push({ xValue: i, yValue: y });
}
return chartPoint
}
|