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 8953169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:02:45+00:00 2026-06-15T14:02:45+00:00

Look at this picture from my web application ASP.NET 4.0. As you can se

  • 0

Look at this picture from my web application ASP.NET 4.0.
enter image description here

As you can se the lines have a different length. Also there is duplicate x axis entry.

The blue serie has a missing datapoint, the yellow does not.
Question 1:
How do I align them so the x- axis stays the same. Currently im doing this. And make the lines equally long?
Question 2: Is there a way to make the chart interactive so that you can some and hold the cursor on the line to see data from that point, using ASP.NET?

int amountofrows = Convert.ToInt32(dt.Rows[0]["antal"].ToString());

for (int i = 0; i < amountofrows; i++)
{
    List<string> xvals = new List<string>();
    List<decimal> yvals = new List<decimal>();
    string serieName = dt.Rows[i]["doman_namn"].ToString();
    Chart1.Series.Add(serieName);
    Chart1.Series[i].ChartType = SeriesChartType.Line;

    foreach (DataRow dr in dt.Rows)
    {
        try
        {
            if (String.Equals(serieName, dr["doman_namn"].ToString(), StringComparison.Ordinal))
            {
                xvals.Add(dr["ranking_date"].ToString());
                yvals.Add(Convert.ToDecimal(dr["ranking_position"].ToString()));
            }

        }
        catch (Exception)
        {

            throw new InvalidOperationException("Diagrammet kunde inte ritas upp");
        }
    }
    try
    {
        Chart1.Series[serieName].XValueType = ChartValueType.String;
        Chart1.Series[serieName].YValueType = ChartValueType.Auto;
        Chart1.Series[serieName].Points.DataBindXY(xvals.ToArray(), yvals.ToArray());
        Chart1.DataManipulator.InsertEmptyPoints(1, IntervalType.Days, serieName);
    }
    catch (Exception ex)
    {
        throw new InvalidOperationException(ex.Message);
    }
}

Chart1.DataBind();
Chart1.Visible = true;
  • 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-15T14:02:46+00:00Added an answer on June 15, 2026 at 2:02 pm

    This was the answer!

    Thanks for pointing that out JBL!

         foreach (System.Web.UI.DataVisualization.Charting.Series serien in Chart1.Series)
         {
                    foreach(System.Web.UI.DataVisualization.Charting.DataPoint dataPoint in serien.Points)
                    {
                        if (dataPoint.YValues[0] == 0)
                        { 
                           dataPoint.IsEmpty = true;
                        }
                    }
    
                    serien.Sort(PointSortOrder.Ascending,sortBy:("X"));
         }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

first take a look on this picture from localScope app : i have 2
Have a look at this picture alt text http://www.abbeylegal.com/downloads/2009-04-01/web%20part%20top%20line.jpg Does anyone know what css
Please take a look at this fiddle jsfiddle.net/Qstuw/2/ As you see from picture first
Let's look at this picture: The left arrow shows that the button background have
We have developed a .NET web application that uses SQL Server as a backend.
Take a look at this picture: it is a zoomed screenshot from this jsfiddle
I have this situation where i want to get data from 3 different databases,
Please look at this picture: Is it possible to find per-column sum for all
I have a problem with internet explorer 6 and 7, please look this example
look at this fiddle: http://jsfiddle.net/ugxNK/ I want that the first list element is in

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.