C# - Set Labels On Datapoints Using Mschart?
Oct 11, 2010I would like to customize the labels on the datapoints below so they would render as (using first datapoint on the chart as an example) :
4:10 - 4:40
yellow class
I would like to customize the labels on the datapoints below so they would render as (using first datapoint on the chart as an example) :
4:10 - 4:40
yellow class
I am wondering if I am able to align y-labels at chart if I am using MSchart control. I searched at google, but I got feeling it is not possible to align them, just title of y-axis.
Here snip of the chart if my question is not clear enough: [URL]
I have
Chart1["Series1"]
Chart1["Series2"] ....
It has multiple Series and each series has Several Data points.I want to find the count ( not sum but number of datapoints ) of Data points in all the series using LINQ.Currently i do
var count = from s in Chart1.Series
select new int[] { s.Points.Count };
And then for each thorough count and find the sum. Is there a better way to do this
I have a page with a datalist on it, with an image button and some labels in the datalist item(1,2)..
I have some more labels on the page which get their values from querystrings(17,18)..
I have more labels which are empty (34,35)
On image click in the datalist item, i want the labels from that item to add with the labels outside of the datalist, and the last lot of labels to show this number..
Currently it doesnt do this. Here is my code:
protected void Page_Load(object sender, EventArgs e)
{
Label17.Text = Request["b1"];
Label18.Text = Request["b2"];
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
DataListItem item = ((Control)sender).NamingContainer as DataListItem;
Label Label1 = item.FindControl("Label1") as Label;
Label Label2 = item.FindControl("Label2") as Label;
Label34.Text = (int.Parse(Label1.Text) + int.Parse(Label17.Text)).ToString();
Label35.Text = (int.Parse(Label2.Text) + int.Parse(Label18.Text)).ToString();
Is there any working example of asp.net mvc with line chart of mschart?
View 5 RepliesI have a web application with several MSChart and I need print all these chart but I dont know how. In some examples in the internet people using EditCopy() but it dont working for me because I cant found that method.
View 17 RepliesGot the MSChart working fine in a standard view, but I'm trying to put them on partial views that I'm then loading using jQuery tabs.
Problem is if you try to put the Chart on a partial, it moans about System.Web.UI.DataVisualization, saying it can't find it, no problem on a standard view though.
Can you use the new Microsoft Chart Control for .NET Framework inside a usercontrol? Bacause when i take a working chart from my page and then copy it to a usercontrol the picture is blank very weird.
View 1 RepliesI want to do a Jquery POST and get a chart using renderControl attribute of CHart which will return HTML attributes back to browser. The CHart is created dynamically based on parameters passed from post and from model. I have successfully done this on WEbforms,
However the same with MVC give a empty image. The handler doesn't perform the same in MVC2 3.5. I went near to 50 sites now.
I can't use other solution like base64encoding as IE6, 7 don't support it.
What I'm trying to do? I have few data parameteres to be sent (POST) to server and in response get the Chart image as tag along with other attributes and data appended in HTML form and sent to browser, all this to be done using JQUERY. No postbacks to be used.
I have badly searched on google, bing nothing turns out to be valuable.
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:
Date/Time
15/03/2010 08:00:00
15/03/2010 14:00:00
15/03/2010 20:00:00
16/03/2010 08:00:00
16/03/2010 14:00:00
etc
When the chart displays the X axis only displays multiple dates, and not times, no matter what properties I try to change.
We are using MSChart on an ASP.net 3.5 web application and noticing significant slowness from enabling tooltips. the performance of drawing a chart is increased by 1,000-2,000ms.The chart output is PNG, and contains in total 108 data points.
View 1 RepliesI need the capability to display a chart, click on a region and display the details in a jqgrid on the same page. I tried using a pie Chart and I can't seem to capture or create a click event for the chart. The data points contain a .url property which I can redirect to a different page but I need to display details on the same page like a master-detail page.
View 3 RepliesHow can I display a TimeSeries?Is it possible to use the MSChart Control (Asp.net Charting Control)?
View 3 RepliesI 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 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.
using Mschart on my MVC project,when i use the first index page of project to render for the partial view name index2 the code is
<% Html.RenderPartial("Index2"); %>
But when i run it the error is occur which the message is
CS0029: Cannot implicitly convert type 'ASP.views_home_index2_ascx' to 'System.Web.UI.Page'
-it said that the problem line of code is
: // Render chart control
Line 52: Chart2.Page = this;
[code]...
But when i put all of code in Index2.ascx to the index.aspx and not to render the partial view it work fine
Code of Index2.ascx is
<%
System.Web.UI.DataVisualization.Charting.Chart Chart2 = new System.Web.UI.DataVisualization.Charting.Chart();
Chart2.Width = 412;
Chart2.Height = 296;
[code]...
I'm using the MSChart Control in a Web Project. I saw that there are 3 different storage mode settings: file/memory/session. I couldn't find any information about the pros/contras or the impact of the settings.
View 2 RepliesI am using the .net 3.5 chart controls and I am binding a chart to a datatable datasource. How do you keep the charts displayed after a postback has ocured. I bind my chart control. The on the page i make a change to a dropdownlist that issues a postback to the server. When the page reloads the charts have no data. How can you make the chart object persist it's data during postback?
View 1 RepliesDoes anyone have an example of using MSChart with a stored procedure? I have a chart control on the web page and have bound it to the stored procedure. I have also set the parameters for the stored procedure. However nothing shows in the chart. All the examples I can find only show adding points one at a time, but this seems to defeat the purpose of binding the chart to the stored procedure.
Some of the problems I am trying to solve:
The stored procedure returns about 6 columns of data. I only need to use two of them. How do I select which of the columns will be displayed in the chart?
I want to use two or more series on the chart. Do I have to run a separate stored procedure for each series or can I make one call to the stored procedure and then display the data in the two series? If so, how?
I am using VS 2008, MS SQL Server 2008, .Net 3.5 and VB .Net.
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:
Code:
Chart1.Series(0).Sort(PointSortOrder.Ascending, "X")
But still no effect. How can i sort data on X axis?
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 am want show the MSChart in the Gridview Item Template,When i put the MSChart control in the Gridview Itemtemplate the Gridview does not render rhe MSChart,It says " There was error in rendering the contol,object reference not set to an instance of an object.
View 3 RepliesI would like to install my asp .net site on a free host. what do I need to install in order that the mschart control will work on the host.
what are the basic requirements.
at the moment I get an error about it.
MSCharts is displaying a period (.) instead of a comma as a thousands separator on my y-axis despite my culture settings in web.config being set to "en-AU". How can I fix/debug this?
View 1 RepliesI've created a pie chart with several slices from a databind with a database. now i want to be able to click on a slice and show the values behind the clicked slice from the database in a gridview.
View 2 Replies