none
Where did the chart question go that was here earlier??? RRS feed

  • Question

  •  

    I made this answer for the chart question posted here earlier. Seems it was here??

     

    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 Test_C
    {
        public partial class Form3 : Form
        {
            public Form3()
            {
                InitializeComponent();
            }
    
            private void Form3_Load(object sender, EventArgs e)
            {
                ClientSize = new Size(700, 300);
    
                chart1.ChartAreas[0].AxisX.Title = "Date";
                chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.LightBlue;
                chart1.ChartAreas[0].AxisY.Title = "Value";
                chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.LightGray;
                chart1.ChartAreas[0].AxisX.LabelStyle.Interval = 1;
                chart1.ChartAreas[0].AxisX.MajorGrid.Interval = 1;
                chart1.ChartAreas[0].AxisX.MajorTickMark.Interval = 1;
                chart1.ChartAreas[0].AxisX.IntervalType = DateTimeIntervalType.Months;
                chart1.ChartAreas[0].AxisX.LabelStyle.Format = "MMM";
                chart1.ChartAreas[0].AxisX.LabelStyle.IsEndLabelVisible = true;
    
                chart1.ChartAreas[0].AxisY.Minimum = 0;
                chart1.ChartAreas[0].AxisY.Maximum = 100000;
                chart1.ChartAreas[0].AxisX.IsMarginVisible = true;
                
    
                chart1.Series[0].ChartType = SeriesChartType.Line;
                chart1.Series[0].BorderWidth = 2;
                chart1.Series[0].Color = Color.Red;
                chart1.Series[0].BorderDashStyle = ChartDashStyle.Solid;
    
                chart1.Series.Add("Series 2");
                chart1.Series[1].ChartType = SeriesChartType.Line;
                chart1.Series[1].BorderWidth = 2;
                chart1.Series[1].Color = Color.Blue;
                chart1.Series[1].BorderDashStyle = ChartDashStyle.Solid;
    
                var date1 = new DateTime(2008, 1,  1);
                DateTime thisDate;
                var rand = new Random();
    
                for (int d = 0; d <= 365; d+=10) 
                {
                    thisDate = date1.AddDays(d);
                    chart1.Series[0].Points.AddXY(thisDate, rand.Next(30000, 40000));
                    chart1.Series[1].Points.AddXY(thisDate,  rand.Next(50000, 70000));
                }
    
    
            }
        }
    }
    

    Sunday, March 8, 2020 12:55 PM

Answers

  • Hi, tommytwotrain.  Do you mean this one?

    https://social.msdn.microsoft.com/Forums/en-US/c8d58701-3ca3-4e7c-82a6-b36292fb7617/axis-x-and-y-on-chart-behave-differently?forum=vbgeneral

    That's in the VB Forum.  You already got an answer credit in it.

    If you're using MSDN Forums from a regular PC in a decent browser, you should see a column on the left-hand side that contains a dropdown menu titled "Quick Access."  If you click on that then you can choose "My Threads" to view any thread you previously posted in, and you can choose "My Forums Threads" which will show you new posts in any group of forums you've added to your "My Forums" group.  Usually if there's a thread I want to write an answer for but I don't have time, I'll make a comment or quick suggestion when I see it so I can find it again under "My Threads."

    I haven't seen any other charting questions in any forum in quite awhile. 


    Before you can learn anything new you have to learn that there's stuff you don't know.

    • Marked as answer by tommytwotrain Sunday, March 8, 2020 4:33 PM
    Sunday, March 8, 2020 3:58 PM

All replies

  • Hi, tommytwotrain.  Do you mean this one?

    https://social.msdn.microsoft.com/Forums/en-US/c8d58701-3ca3-4e7c-82a6-b36292fb7617/axis-x-and-y-on-chart-behave-differently?forum=vbgeneral

    That's in the VB Forum.  You already got an answer credit in it.

    If you're using MSDN Forums from a regular PC in a decent browser, you should see a column on the left-hand side that contains a dropdown menu titled "Quick Access."  If you click on that then you can choose "My Threads" to view any thread you previously posted in, and you can choose "My Forums Threads" which will show you new posts in any group of forums you've added to your "My Forums" group.  Usually if there's a thread I want to write an answer for but I don't have time, I'll make a comment or quick suggestion when I see it so I can find it again under "My Threads."

    I haven't seen any other charting questions in any forum in quite awhile. 


    Before you can learn anything new you have to learn that there's stuff you don't know.

    • Marked as answer by tommytwotrain Sunday, March 8, 2020 4:33 PM
    Sunday, March 8, 2020 3:58 PM
  • Hi Andrew,

    No there was a thread here in this forum earlier.  That is why it is c# code.

    At first I thought it was moved but, I had tried to respond to the thread in my browser after making the example and it said the thread was gone or something.

    So OP must have deleted it I guess before I answered.

    :)

    PS I am not going to worry about it.
    Sunday, March 8, 2020 4:21 PM