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
170
Change the data column sources in a PointChart3D graph
posted

Hi everyone, got a few questions :)

First, I'm wondering how can one change the columns that get plotted in a PointChart3D. For example, I have a DataTable with 5 columns and I need to select which column gets plotted in any of the three axes (i.e. display column 4 in the X axis, then switch to the 5th, and so on).

Second, what would be the best way to draw a circle overlay over a ScatterChart graph?

Finally, how can I "center" the graphic, that is, have it's center always be (0,0) (as shown in the attached picture).

 Thanks in advance, -David

 

Parents
No Data
Reply
  • 17605
    posted

    I'm not sure I understand your first question, but any time when you want to change the data you should do this manually.

    About your second and third questions, you can try the following code:

    private void Form1_Load(object sender, EventArgs e)

    {

    this.ultraChart1.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.ScatterChart;

    this.ultraChart1.Axis.X.RangeType = Infragistics.UltraChart.Shared.Styles.AxisRangeType.Custom;

    this.ultraChart1.Axis.X.RangeMin = -100;

    this.ultraChart1.Axis.X.RangeMax = 100;

    this.ultraChart1.Axis.X.MajorGridLines.Visible = false;

    this.ultraChart1.Axis.Y.RangeType = Infragistics.UltraChart.Shared.Styles.AxisRangeType.Custom;

    this.ultraChart1.Axis.Y.RangeMin = -100;

    this.ultraChart1.Axis.Y.RangeMax = 100;

    this.ultraChart1.Axis.Y.MajorGridLines.Visible = false;

    this.ultraChart1.Data.ZeroAligned = true;

    this.ultraChart1.DataSource = DemoTable.Table();

    this.ultraChart1.DataBind();

    this.ultraChart1.FillSceneGraph += new Infragistics.UltraChart.Shared.Events.FillSceneGraphEventHandler(ultraChart1_FillSceneGraph);

    }

    void ultraChart1_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e)

    {

    IAdvanceAxis xAxis = e.Grid["X"] as IAdvanceAxis;

    int x = (int)(double)xAxis.Map(0);

    int x2 = (int)(double)xAxis.Map(100);

    IAdvanceAxis yAxis = e.Grid["Y"] as IAdvanceAxis;

    int y = (int)(double)yAxis.Map(0);

    int y2 = (int)(double)yAxis.Map(100);

    int width = x2 - x;

    int height = y - y2;

    Point leftTop = new Point(x - width, y - height);

    Point widthHeight = new Point(2 * width, 2 * height);

    Ellipse ellipse = new Ellipse(leftTop, widthHeight);

    e.SceneGraph.Add(ellipse);

    }

Children