Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8026473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:30:08+00:00 2026-06-04T23:30:08+00:00

I have a chart with dates (strings) as X values and decimals as Y

  • 0

I have a chart with dates (strings) as X values and decimals as Y values. I want to zoom in the chart but when setting:

chart1.ChartAreas[0].CursorX.IsUserEnabled = true;
chart1.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
chart1.ChartAreas[0].AxisX.ScaleView.Zoomable = true;

it zooms up to interval 1 on the X axis.
I want to zoom-in gradually on the axis but when i set\

chart1.ChartAreas[0].CursorX.Interval = 0.1; 

(anything except 1) the labes on the X axis disappear. Can somebody help me please, i am new to the chart controls. Please excuse my ignorance. Any advice would be very grateful
Here is a piece of my code so far:

chart1.ChartAreas[0].CursorX.IsUserEnabled = true;
chart1.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
chart1.ChartAreas[0].AxisX.ScaleView.Zoomable = true;

chart1.Series[0].IsVisibleInLegend = false;
chart1.Series[0].ChartType = SeriesChartType.Area;

DateTime sday = Convert.ToDateTime(earnings1.dataGridView1[0, 0].Value.ToString());
chart1.Series[0].XValueType = ChartValueType.String;
int i = 0;
chart1.Series[0].SmartLabelStyle.Enabled = false;

foreach (DataGridViewRow dgvr in earnings1.dataGridView1.Rows)
{
         decimal testing = Convert.ToDecimal(earnings1.dataGridView1[1, i].Value);
         testing = decimal.Truncate(testing);
         var point = new DataPoint(i + 1, Convert.ToDouble(testing));
         point.Label = testing.ToString();
         point.Font = new Font("Century Gothic", 8, FontStyle.Bold);
         chart1.Series[0].Points.Add(point);
         chart1.Series[0].LabelAngle = -90;
         chart1.Series[0].Points[i].AxisLabel = sday.ToString("dd/MM/yyyy");
         sday = sday.AddDays(1);
         i++;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T23:30:09+00:00Added an answer on June 4, 2026 at 11:30 pm

    I found the way to do it:

    chart1.ChartAreas[0].CursorX.IntervalType = DateTimeIntervalType.Auto;
    chart1.ChartAreas[0].CursorX.Interval = 1;
    

    and let Visual Studio do the job for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a TimeSeries chart, showing up some values per dates and there are
What I have is a set of users with join dates and I want
I have a table with 5 million records of dates stored as char(10) with
In my SQL Server database I have the dates stored as char(12) in the
I have chart.png with data in it that I would like to put a
I have a chart generated from Google Charts that can be found here: Chart
I have a chart on a Windows Form with several line graphs. I would
I have a chart with multiple Series. I am using the ChartColorPalette to set
I have a chart (code to replicate will be below) that has two lines
In my MVC project I have a chart being generated on my view as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.