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

  • Home
  • SEARCH
  • 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 3405540
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:31:05+00:00 2026-05-18T05:31:05+00:00

I’m building a chart to show items by volume by category. So far I’ve

  • 0

I’m building a chart to show items by volume by category. So far I’ve been succcessful in showing items by volume as it’s a simple x/y chart, however I’d like to show y2 and I know MS Chart Controls has a built in AxisY2 however when I try anything with it the Chart get’s all funky.

Here’s what I’m looking for (in ascii art):

item1 |[][][][][].............| cat1
item2 |[][]...................| cat2
item3 |[][....................| cat1
item4 |[][][][][][][][........| cat1
      |_______________________|
        0   1   2   3   4   5

Like previously mentioned I can get Items and counts to show fine as that’s relatively easy, it’s the Categories that I can’t seem to place.

Thanks

  • 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-05-18T05:31:05+00:00Added an answer on May 18, 2026 at 5:31 am

    Short Answer first : According to MS Examples, there is no straight way to do that, but just a workaround trick : Plot your series on a second chartArea matching exactly your existing area position, (by performing a copy of your Series) having invisible primary X/Y Axis and a visible secondary Y Axis (AxisY2). And set the chartArea and the copied series’s backcolors to transparent. (This can be applied to secondary X axis in case of column graphs rather that bars)

    //Suppose you already have a ChartArea with the series plotted and the left Y Axis
    //Add a fake Area where the only appearent thing is your secondary Y Axis
    ChartArea area1 = chart.ChartAreas.Add("ChartAreaCopy_" + series.Name);
    area1.BackColor = Color.Transparent;
    area1.BorderColor = Color.Transparent;
    area1.Position.FromRectangleF(area.Position.ToRectangleF());
    area1.InnerPlotPosition.FromRectangleF(area.InnerPlotPosition.ToRectangleF());
    area1.AxisX.MajorGrid.Enabled = false;
    area1.AxisX.MajorTickMark.Enabled = false;
    area1.AxisX.LabelStyle.Enabled = false;
    area1.AxisY.MajorGrid.Enabled = false;
    area1.AxisY.MajorTickMark.Enabled = false;
    area1.AxisY.LabelStyle.Enabled = false;
    
    area1.AxisY2.Enabled = AxisEnabled.True;
    area1.AxisY2.LabelStyle.Enabled = true;
    
    // Create a copy of specified series, and change Y Values to categories
    Series seriesCopy = chart.Series.Add(series.Name + "_Copy");
    seriesCopy.ChartType = series.ChartType;
    foreach(DataPoint point in series.Points)
    {
        double category = getYourItemCategory(point.XValue);
        seriesCopy.Points.AddXY(point.XValue, category);
    }
    
    // Hide copied series
    seriesCopy.IsVisibleInLegend = false;
    seriesCopy.Color = Color.Transparent;
    seriesCopy.BorderColor = Color.Transparent;
    
    //Drop it in the chart to make the area show (only the AxisY2 should appear)
    seriesCopy.ChartArea = area1.Name;
    

    PS : I’ve spent two nights awake messing with MS chart controls, trying to put two different Y axis on a Chart Area. I wanted to put two differently scaled series (same X scale, different Y Scales : one on the left for Series A , the other on the right for Series B).
    In fact, this proved to be a real nightmare, when one could expect this to be pretty straightforward. The truth is that MS Chart Controls are definitely NOT adapted for this particular use case IMHO. The multiple Y axis sample suggested in the MSCC sample examples is an awful and very ugly workaround, which requires two chartareas on top of the default one, playing with visibility and transparency, to achieve the desired effect (which sounds like a very bad illusion magic trick).

    While hoping for this to be enriched and fixed in a proper way in future versions, if you really need an efficient way to manage multiple Y-Axis, sitck to ZedGraph

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
I have just tried to save a simple *.rtf file with some websites and
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
I have some data like this: 1 2 3 4 5 9 2 6
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.