Hi,
thanks for ur guide for the personalize legend. but for the primary axis problem after i apply with your setting i still have the decimal point for my Y axis.
any idea? thanks..
regards
hwee hoon
>Hi,
Thank you for your interest in Syncfusion Products.
Issue 1: (to set my Y axis value to 0, 20, 40, 60, 80, 100)
-----
You can set Y-axis value to 0, 20, 40, 60, 80, 100 by using the below code snippet.
//Set the Axes Range.
this.ChartWebControl1.PrimaryYAxis.RangeType = ChartAxisRangeType.Set;
this.ChartWebControl1.PrimaryYAxis.Range = new MinMaxInfo(0, 100, 20);
Issue 2: (– 100, -80, -60, - 40, -20, 0, 20, 40, 60 )
------
You can set Y-axis value to – 100, -80, -60, - 40, -20, 0, 20, 40, 60 by using the below code snippet.
//Set the Axes Range.
this.ChartWebControl1.PrimaryYAxis.RangeType = ChartAxisRangeType.Set;
this.ChartWebControl1.PrimaryYAxis.Range = new MinMaxInfo(-100, 60, 20);
Issue 3: (Currently I draw the legend myself by using picture box. Any others idea I can make it better)
--------
If your intention is to create a chart with legends, it can be achieved by using the FilterItems event. You can use ChartLegendItemType enum to select the type of legend (Rectangle, Image, Circle etc..) you need to display in the chart.
private void Legend_FilterItems(object sender, ChartLegendFilterItemsEventArgs e)
{
e.Items.Clear();
Syncfusion.Windows.Forms.Chart.ChartLegendItem s0 = new ChartLegendItem();
e.Items.Insert(0, s0);
e.Items[0].Type = ChartLegendItemType.Rectangle;
e.Items[0].Text = "-Best-In-Class";
e.Items[0].Interior = new Syncfusion.Drawing.BrushInfo(Color.Green);
Syncfusion.Windows.Forms.Chart.ChartLegendItem s1 = new ChartLegendItem();
e.Items.Insert(1, s1);
e.Items[1].Type = ChartLegendItemType.Circle;
e.Items[1].Text = "-Your Organization";
e.Items[1].Interior = new Syncfusion.Drawing.BrushInfo(Color.Yellow);
Syncfusion.Windows.Forms.Chart.ChartLegendItem s2 = new ChartLegendItem();
e.Items.Insert(2, s2);
e.Items[2].Type = ChartLegendItemType.Rectangle;
e.Items[2].Text = "-Average";
e.Items[2].Interior = new Syncfusion.Drawing.BrushInfo(Color.Lavender);
}
Please try this and let me know if this helps.
Thanks,
Melba
Question.zip