VS 2010 - Sort X Axis On MSChart With Multiple Series
Oct 28, 2013
I have an MsChart with 6 series. The data is retrieved from MySQL database and every series has different number of elements.
The X axis is represented by date values (YYYY-MM). I am sorting data ASC on date from MySQL query but when i generate the chart i have the values (from left to right) : 2010-01 , 2011-04, 2013-04, 2011-04,2012-04.
I tried sorting data like this , for every series:
I have an mschart control which is databound in code-behind. The Y axis values can vary from vary small to very broad. So the range is set to auto. This works fine except when the values in range of 0 and <1. In this range the axis only has a zero, it does not have a "1" at top. Is it possible to set to dynamically set the maximum? So if the maximum value is less than one, still show a one. i.e. get maximum value and set the Y axis maximum = maximum value +1
I have installed the asp.net MSChart control for VS2008 and set up a chart on my webform. I am using DataBindTable in code to bind data from a LINQ query. The data for the x axis looks something like this:
Suppose if DB table has x-axis values as below for particular Id: 65 67.5 68.5 70.0 78.5 80.0 81.5 82.5 83.0 83.5 84.0 84.5 85.5 86.5
Then it should select x-axis Min value as 65 (for that particular Id), in below line: //Chart1.ChartAreas["ChartArea1"].AxisX.Minimum and it should select x-axis Max value as 86.5 (for that particular Id, in below line: //Chart1.ChartAreas["ChartArea1"].AxisX.Maximum.These values differ everytime for different Id. ( particular Id has multiple x-So everytime for particular Id, it should take x-axis Min and Max value from Database.I tried below code, but its not working. (Also this code enables MajorGrid = true dont know how. I had set it Enable = false from code behind.)
string query = "SELECT max(x) from Tables where Param_ID= '" + id + "' and DeletionDate is null"; DataTable dt2 = GetData(query); Chart1.ChartAreas["ChartArea1"].AxisX.Maximum = Convert.ToDouble(dt2);
I have 2 series in the same chartarea. Both contain values by year (x axis). The problem is if one series does not have data for a given year, the chart will display the first value in a series on the first tick mark whether it matches the xaxis label or not.
Notice the 2009 value for series1 appears in the first column and the Xaxis now has 2 2009 tick marks. How do I get the values to appear on the correct X axis marks?
I tried to place 4 mschart controls on the same page but it is giving me major grief. Each chart appears properly when I place one per page, but as soon as I place multiple the first two are displaying incorrect data and the last two do no display anything at all.
I made sure that I am not using the same session variable eventhough that seems to be the most like culprit.
I have a database with 4 columns, 3 of the columns are int (1-10) and the other is a "DateTime". I am trying to graph the 3 columns vs the DateTime(X-axis) on one line chart.
To add more than one y axis value I go to the Series property -> YValueMembers (notice the plural) and enter my 3 columns of the database (followed by commas) that I want on the Y axis.....but doesn't seem to work.
I get a run time error saying only 1 column is allowed on the Y axis.
Data points insertion error. Only 1 Y values can be set for this data series.
How do I get all 3 columns vs the 4th column on one line chart?
I have 3 columns of data that get returned from a stored procedure. Date, Error code,and Quantity. On one day we can have 8 different error codes, with different quantities.For example on the date of 18 Nov we had error code 101 = 24, error code 102 = 36, error code 103 = 4, etc. I am trying to display the different error codes in columnswith their quantity by date. There will be multiple columns for a given day because the error codes range from 101 -124. How can I display this? I currently have Just oneat a time being display based on which the end user picks.
I'm currently developing a website that shows multiple charts that I build using data from SQL tables. I've used and followed Scott Mitchell's tutorial [URL] and K. Scott Allen's ChartBuilder class [URL] and all works well.
However when have two series that I want to show on the same Chart, if one set of data does not have all of the X values the other series does, the chart blindly puts all the data on, ignoring trying to match the X values of the other series, therefore mismatching the X values when the chart is shown.
I know that I can fiddle the data so that both sets of data have the same X values, however I'm trying to make the class handle anomalies in the data so that I don't have to worry too much about the data.
wondering if someone can possibly help me out with a gridview. I have data coming into a grid and I know how to filter the data using one dropdown, I'm trying to get a little more advanced now. I'd like to filter using three dropdowns.
This is what I have so far: I don't know how to hook the downlists to the query?
I'm looking for a way to sort the rows of a datatable without setting the DefaultView.Sort to a specific column. I have a datatable in session that users can add records to. I want them to be able to sort the data by clicking on a button. But new records added after that need to show up at the bottom of the list until the sort button is clicked again.
Just spent about 8 hours googling and looking through this forum for a solution on how to make sure that I can dynamically sort. Here is the situation.
I have 1 Gridview that displays 10 different scenarios based on what button is clicked.
I am also returning only top 10 records. I am doing all of the data binding pragmatically. So I have BoundFields, HyperLinkFields etc.
I also want to sort some records. When I change DataSource SQL statement the gridview somehow remembers what the last sort value was and it errors out saying that value "x" cannot be sorted because it does not exists.