Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Creating a Chart with MS Chart Control C#

Posted on 2013-12-04
6
Medium Priority
?
1,172 Views
Last Modified: 2014-01-16
I need to create a horizontal chart on a webpage that is live and updates automatically every minute or so. The chart needs to display four horizontal lines each representing a line in our production facility. The line needs to be green unless the line is down, in which case it needs to be another color that represents the reason the line is down. The chart will show the previous twelve hours on a continual basis. If the line is down currently, I want to have a label or something showing that it is currently down. The full twelve hours needs to be the x-axis at probably 15 minute marked intervals but calculated down to the minute, and I think the line would be the y-axis with one bar for each line. I am using SQL Server 2005 and VS2010.

I have downloaded the Microsoft Chart Control and have it installed in VS2010, using asp.net 4.0. I'm attaching a sample of what the graph needs to resemble. I will also include some raw data. It seems like the STACKEDBAR100 style is close to what I want.

Spreadsheet attached with sample data and chart. The data on the chart does NOT match the actual data, but is simply a representation of how I want to lay this out.

I have not worked with asp.net charts at all, so I'm not sure where to even start.
samplechart.xlsx
0
Comment
Question by:Carla Romere
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39697936
I am curious about what you are working with.  With 3.5, you had to download and install the charting controls, but with 4.0, they were installed with the framework.

Here is one possible place to start:

Built-in Charting Controls (VS 2010 and .NET 4 Series)
http://weblogs.asp.net/scottgu/archive/2010/02/07/built-in-charting-controls-vs-2010-and-net-4-series.aspx
0
 

Author Comment

by:Carla Romere
ID: 39727352
I'm working with the charting controls.  I just don't know where to start to show the information I want to show. I've looked at the charting controls documentation but don't see an example of what I'm looking for.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39727369
Would it be possible to attach a picture of how you would like the chart to look?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:Carla Romere
ID: 39727373
It is attached to the original question.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 39727405
I believe that you are correct in your statement that the 100% stacked bar would be the right choice.

Comparison Chart (100% Stacked Chart)
http://msdn.microsoft.com/en-us/library/gg309515.aspx#StackedChart

<Chart Palette="None" PaletteCustomColors="149,189,66; 197,56,52; 55,118,193; 117,82,160; 49,171,204; 255,136,35; 168,203,104; 209,98,96; 97,142,206; 142,116,178; 93,186,215; 255,155,83">
      <Series>
        <Series ChartType="StackedBar100" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40">
          <SmartLabelStyle Enabled="True" />
        </Series>
      </Series>
      <ChartAreas>
        <ChartArea BorderColor="White" BorderDashStyle="Solid">
          <AxisY LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount">
            <MajorGrid LineColor="239, 242, 246" />
            <MajorTickMark LineColor="165, 172, 181" />
            <LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" />
          </AxisY>
          <AxisX LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount">
            <MajorGrid Enabled="False" />
            <MajorTickMark Enabled="False" />
            <LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" />
          </AxisX>
        </ChartArea>
      </ChartAreas>
      <Titles>
        <Title Alignment="TopLeft" DockingOffset="-3" Font="{0}, 13px" ForeColor="0, 0, 0" />
      </Titles>
    </Chart>

Open in new window


The trick would be converting the time intervals to a bar value.  I would think that you could get the difference between "insert_date", and "end_down" in minutes.  That would give you a series of values that you could "stack" on top of each other.
0
 

Author Comment

by:Carla Romere
ID: 39751447
I've been out of town. I will try TheLearnedOne's suggestion. Please do not close this ticket.
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question