May 29, 2012, 9:39 AM
[CLOSED] "Serie has no chart reference" error
Hello
I try to set title to a chart column with this :
I will try to make a complete example.
I get this message :
In AbstractSeries.cs here :
I try to set title to a chart column with this :
Serie.SetTitle(i, SerieTitle(i))
i, is the index of my serie, and SerieTitle(i) the title.I will try to make a complete example.
I get this message :
System.Exception: Series has no Chart reference
protected virtual void CallTemplate(string name, params object[] args)
{
if (this.SeriesID.IsEmpty())
{
throw new Exception("You have to set series ID to call its methods");
}
var chart = this.Owner as Chart;
if (chart == null)
{
throw new Exception("Series has no Chart reference");
}
StringBuilder sb = new StringBuilder();
var comma = false;
if (args != null && args.Length > 0)
{
foreach (object arg in args)
{
if (comma)
{
sb.Append(",");
}
comma = true;
sb.Append(JSON.Serialize(arg, JSON.ScriptConvertersInternal));
}
}
var template = "{0}.series.get(\"{1}\").{2}({3});";
string script = template.FormatWith(chart.ClientID, this.SeriesID, name, sb.ToString());
chart.AddScript(script);
}
Last edited by Daniil; May 29, 2012 at 6:45 PM.
Reason: [CLOSED]