Dreamer78692's Profile User Rating: -----

Reputation: 3 Apprentice
Group:
Members
Active Posts:
27 (0.02 per day)
Joined:
21-May 12
Profile Views:
1,657
Last Active:
User is offline Nov 12 2014 09:39 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   Dreamer78692 has not set their status

Posts I've Made

  1. In Topic: Chart in winform displaying wrong Point

    Posted 12 Nov 2014

    In .NET 4.5 we can do this:

    chart1.Series["ABC"].CustomProperties = "IsXAxisQuantitative=True";
    
  2. In Topic: Chart in winform displaying wrong Point

    Posted 12 Nov 2014

    View PosttlhIn`toq, on 12 November 2014 - 06:35 AM, said:

    Ok... After some more playing I see what you're talking about. But its really hard to figure out the problem based on your description and code.

    Why do you have this loop if you are only placing one point? That really obfuscates that you are only placing one point: It looks like you are placing multiple points out of a collection.

    To be clear for other readers the bug appears when you only place one point in a series.


    Thanks for the response... you are correct.
    However I am adding multiple Series. And if all the Series have the point (0,y) then it plots incorrectly.
    Below is sample code:

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Windows.Forms.DataVisualization.Charting;
    
    namespace WindowsFormsApplication2
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
    
            private void Form1_Load(object sender, EventArgs e)
            {
               
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                double x = 1;
    
                DataPoint p = new DataPoint(0, -0.5);
                chart1.Series.Add("ABC");
                chart1.Series["ABC"].ChartType = SeriesChartType.Point;
                // chart1.Series["ABC"].Label = "ABC";
                chart1.Series["ABC"].Points.Add(p);
                chart1.Series["ABC"].MarkerSize = 5;
    
                chart1.Update();
    
                DataPoint p1 = new DataPoint(0, -0.5);
                chart1.Series.Add("CDE");
                chart1.Series["CDE"].ChartType = SeriesChartType.Point;
                // chart1.Series["ABC"].Label = "ABC";
                chart1.Series["CDE"].Points.Add(p1);
                chart1.Series["CDE"].MarkerSize = 5;
    
                chart1.Update();
            }
        }
    }
    
    



    Debug at the point:
    DataPoint p = new DataPoint(0, -0.5);
    
  3. In Topic: Chart in winform displaying wrong Point

    Posted 12 Nov 2014

    View PosttlhIn`toq, on 11 November 2014 - 08:27 AM, said:

    Have you put a breakpoint on line 16 to confirm the actual run-time value of Point? If so I'd love to see a screenshot of the Watch pallet showing it.

    I'll also point out that something is screwy with your chart as positive values are almost always shown ABOVE the axis. Flipping that is making your lines that should be down-trending appear as up-trending.


    refer to http://stackoverflow...ng-wrong-point.

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

Comments

Dreamer78692 has no profile comments yet. Why not say hello?