Hi,
I am using MVC chart helper for igDataChart.
I have multple series and I want igDataChart to select color for each series from explicitly defined set of colors.
In your documentation http://help.infragistics.com/jQuery/2012.1/ui.igDataChart
BRUSHES property is mentioned. But i could not find it in igDataChart MVC helper.
I tried to set it in javascript as below:
$("#spectralChart").igDataChart("option", "brushes", ["#7FFFD4", "#0000FF", "#FF7F24"]);
This line is throwing javascript error: Microsoft JScript runtime error: Object doesn't support property or method 'igDataChart'
Please help.
Hi, sanjaysutar
I cannot reproduce this problem. The same statement works fine for me. Is it possible that this statement is executed before the data chart scripts are loaded into the page?
Cheers, Lazar
Hi Lazar below is the complete markup:
@*infragistic script files*@
<script type="text/javascript" src="@Url.Content("~/Scripts/Ig/infragistics.loader.js")"></script>
@(Html.Infragistics().Loader() .ScriptPath(Url.Content("~/Scripts/Ig")) .CssPath(Url.Content("~/Content/Ig")) .Render() )
<script type="text/javascript"> $(document).ready(function () { $("#spectralChart").igDataChart("option", "brushes", ["#7FFFD4", "#0000FF", "#FF7F24"]);
});</script>
@(Html.Infragistics().DataChart(Model.SpectralChannelData.AsQueryable()) .ID("spectralChart") .Axes((axes) => { axes.NumericX("xAxis").Stroke("Black").StrokeThickness(4).MajorStroke("Whitesmoke"); axes.NumericY("yAxis").Stroke("Black").StrokeThickness(4).MajorStroke("Whitesmoke"); }) .Series(series => { series.ScatterLine("scatterSeries" + key.ToString(), Model.GroupedSpectralData[key].AsQueryable()) .XAxis("xAxis").YAxis("yAxis")
.XMemberPath(data => data.SpectralPoint) .YMemberPath(data => data.Wavelength)
}) .DataBind() .Render() )
Please correct me if I am missing on anything.