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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:53:44+00:00 2026-05-27T12:53:44+00:00

I am doing coding of ASP.NET chart control and chart code is as per

  • 0

I am doing coding of ASP.NET chart control and chart code is as per below

<asp:Chart ID="Chart1" runat="server" Width="450px" Height="200px" BackColor="211, 223, 240"
                Palette="None" BorderLineStyle="Solid" BackGradientEndColor="White" BackGradientType="TopBottom"
                BorderlineWidth="2" BorderlineColor="26, 59, 105" EnableViewState="True">
                <Series>
                    <asp:Series Name="Series1" BorderColor="180, 26, 59, 105" Color="Blue" BorderWidth="2"
                        ShadowColor="254, 0, 0, 0" ChartType="Column" ShadowOffset="1" MarkerSize="8" MarkerStyle="Diamond">
                        <EmptyPointStyle BackGradientStyle="Center" />
                    </asp:Series>                         
                <ChartAreas>
                    <asp:ChartArea Name="ChartArea" BorderColor="64, 64, 64, 64" BorderDashStyle="Solid"
                        BackSecondaryColor="White" BackColor="64, 165, 191, 228" ShadowColor="Transparent"
                        BackGradientStyle="TopBottom">
                        <AxisY LineColor="#eb9c28">
                            <MajorGrid LineColor="64, 64, 64, 64"></MajorGrid>
                        </AxisY>
                        <AxisX LineColor="64, 64, 64, 64" TextOrientation="Horizontal" IsStartedFromZero="true">
                            <LabelStyle Format="dd/MM/yyyy" IntervalType="Days" Interval="1"></LabelStyle>
                            <MajorGrid LineColor="64, 64, 64, 64"></MajorGrid>
                        </AxisX>
                    </asp:ChartArea>
                </ChartAreas>
                <BorderSkin SkinStyle="Emboss" />
            </asp:Chart>

and i have bind this chart control from code behind as per below

    Chart1.DataSource = dt;
    Chart1.Series["Series1"].XValueMember = "UTC";
    Chart1.Series["Series1"].YValueMembers = "Value";           

    Chart1.ChartAreas[0].AxisX.IntervalType = DateTimeIntervalType.Minutes;
    Chart1.ChartAreas[0].AxisX.Interval = 5;
    Chart1.ChartAreas[0].AxisX.LabelStyle.Format = "HH:mm:ss"; 

Now in dt (datasource) there is also 3rd column named as Severity and values will be “a”, “b”,”c” …

Now i would like to customize column color as per this value, means

if a -> Red

b -> Blue

c -> green like that

Please help me if any one has done this type of logic.

Thanks in advance.

  • 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-27T12:53:45+00:00Added an answer on May 27, 2026 at 12:53 pm

    You can set multiple values for the Y member by setting value for

    Chart1.Series[0].YValuesPerPoint = 2;
    

    Now for Column it would be using only one value but in the other column you could bind a value corresponding to a,b,c as say 1,2,3 and now bind this to the series.

     Chart1.Series["Series1"].YValueMembers = "Value,intvalueforcolor";
    

    To apply the colors you will have to loop through the points in the series like

    foreach (DataPoint pt in Chart1.Series[0].Points)
    {
         pt.YValues[1] // this will be your value depending upon which you could set the color
         //pt.Color = ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm coming from a Rails background and doing some work on a ASP.NET project
some code snippets. The java coding doing the jaxb unmarshaling. pretty straightforward, copied out
I'm developing my first Facebook application in ASP.NET 2.0 and doing a simplest thing,
I am doing coding in linux architecture. I have question regarding socket server and
I am using visual studio 2005 c#, and doing server side coding. I have
I was doing some C coding and after reading some C code I've noticed
I have defined the following in my gridview markup (simplified): <asp:GridView ID=grvReport runat=server DataSourceID=odsReport
I'm doing some coding in JSP/Java (without any framework, or other strange things) and
I might be doing a coding competition soon, I was wondering if anyone made
I'm planning on doing more coding from home but in order to do so,

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.