Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
390
Is it Possible to draw line chart like an image that i attached?
posted

Can you please provide me the code if possible.

Parents
No Data
Reply
  • 26458
    Offline posted

    Dependeing on some of your other requirements, it may or may not be better to use a composite chart. Here's a small example that can get you started with a simple line chart:

    ChartTextAppearance chartText = new ChartTextAppearance();
    chartText.Visible = true;
    chartText.Row = -2;
    chartText.Column = -2;
    chartText.ItemFormatString = "<DATA_VALUE:C>";
    chartText.VerticalAlign = StringAlignment.Far;
    ultraChart1.ChartType = ChartType.LineChart;
    ultraChart1.Data.DataSource = new[,] { { 1, 2, 2, 1, 2 }, { 5, 7, 5, 7, 5 } };
    ultraChart1.LineChart.ChartText.Add(chartText);
    ultraChart1.Axis.X.Visible = false;
    ultraChart1.Axis.X.Margin.Near.Value = 5;
    ultraChart1.Axis.X.Margin.Far.Value = 5;
    ultraChart1.TitleLeft.Text = "Price($)";
    ultraChart1.TitleLeft.Orientation = TextOrientation.VerticalLeftFacing;
    ultraChart1.TitleLeft.HorizontalAlign = StringAlignment.Center;
    ultraChart1.TitleLeft.Visible = true;
    ultraChart1.Axis.Y.Extent = 30;
    ultraChart1.Legend.Visible = true;
    ultraChart1.Legend.Location = LegendLocation.Bottom;

    Also, feel free to look at this blog post for valuable chart-related information:
    http://community.infragistics.com/blogs/sung_kim/archive/2008/09/05/chart-university-chart-101-and-some-201-301-401-stuff.aspx

Children