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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:53:30+00:00 2026-05-26T03:53:30+00:00

I have an a chart control which measures customer satisfaction. The possible values are

  • 0

I have an a chart control which measures customer satisfaction.

The possible values are Happy, Neutral and Sad. (e.g. a possible set of values might be: Happy (23), Neutral (12), Sad (19) )

I want Happy to always be Green, Neutral to always be Orange and Sad to always be Red (e.g. like a RAG status)

I set the colors thus:

fbChart.Palette = ChartColorPalette.None;
fbChart.PaletteCustomColors = new Color[] { Color.Green, Color.Orange, Color.Red };

This works fine if all three possible options have values, but if there is only one or two with values the colors screws up. (e.g. If I have Happy (12) and Sad (9) but no Neutral, the colors come out as Green for Happy and Orange for Sad.)

Is there a way I can tie down the colors to the name (e.g Happy / Neutral / Sad)?

EDIT:

The data is loaded into the chart from a datatable:

    var fb = from f in db.tl_feedbacks
             where f.timestamp >= new DateTime(fromYear, fromMonth, fromDay, 0, 0, 0) &&                f.timestamp <= new DateTime(toYear, toMonth, toDay, 23, 59, 59)  
               group f by f.tl_feedback_score.score into grp
               select new
               {
                     Score = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(grp.Key),  
                     Count = grp.Select(x => x.tl_feedback_score.score).Count()  
               };  
              fbChart.Series["Feedback"].XValueMember = "Score";  
              fbChart.Series["Feedback"].YValueMembers = "Count";

              fbChart.DataSource = fb;
              fbChart.DataBind();
  • 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-26T03:53:31+00:00Added an answer on May 26, 2026 at 3:53 am

    I am assuming that you are binding data to the charts using datatable and you are using asp.net chart controls……

    I am hoping that this solution will helps you

    foreach (Series charts in fbchart.Series)
    {
        foreach (DataPoint point in charts.Points)
        {
           switch (point.AxisLabel)
            {
               case "Neutral": point.Color = Color.Red; break;
               case "Happy": point.Color = Color.Green; break;
               case "Sad": point.Color = Color.Orange; break;
             }
             point.Label = string.Format("{0:0} - {1}", point.YValues[0], point.AxisLabel);
    
        }
     }  
    

    and the example image(chart) for the above code is like this…Belowdividing areas with membership types using pie chart controls

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

Sidebar

Related Questions

I have a ColumnSeries chart where I want to control the selected item from
In the MS Chart control (which they bought from Dundas), I have three series
I am developing a web application which has Chart Controls. I have developed a
I have installed the new asp:chart control on my machine and have built an
I am using the new ASP control Chart, but I have some problems with
So, I have a WindowsFormsHost control in my WPF app (hosting a Dundas Chart)
I have a chart with a series that denotes a large set (1000's) of
I have custom control - chart with size, for example, 300x300 pixels and more
I have a form which shows a graph which was made in Microsoft Chart
I'm making a chart control, which currently is just a UserControl within a larger

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.