Posted 12 November 2018, 6:22 pm EST
Hi,
The above specified requirements are not directly possible using FlexChartField in FlexReport as it provides only a restricted set of FlexChart features. However, as an alternative, you can perform the required functionality on FlexChart itself and then use it as an image inside FlexReport. So, you can perform it as follows :
- Create a FlexChart having 2 Y Axis, one for FlexChart itself and other one for series to be added.
flexChart1.Series.Add(new C1.Win.Chart.Series { Name = "Sales", Binding = "Sales", AxisY = new C1.Win.Chart.Axis { Position = C1.Chart.Position.Left, MajorGrid = true, AxisLine = true, Labels = true, Title="Absolute Sales"} });
flexChart1.AxisY.Position = C1.Chart.Position.Right;
flexChart1.AxisY.AxisLine = true;
- Use Labelrendering event on FlexChart to customize DataLabel text as follows:
private void FlexChart1_LabelRendering(object sender, C1.Win.Chart.RenderDataLabelEventArgs e)
{
e.Text = string.Format("{0:p1}", (e.Item as DataItem).Sales / _totalSale);
}
- Now Save FlexChart as an Image and use that image in FlexReport.
Please refer the attached sample for detailed implementation.
Thank you.
CustomDataLabel.zip