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:
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 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:
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);
The bar chart report is showing data on x and y axis (y axis has 3 fields - min, max, avg values for time frame) and x axis has task type. For some reason, the chart only shows task types on the x-axis for some apparently interval, even though I have no interval set expressly.
I want to display time on Y axis and days on x axis.
I want to dispaly 12:00 AM,11:00 AM...11:59 PM. on Y axis.I want function to create sequence like that and on X axis display week like 6-sep,7-sep,..11-sep.
how can i format the dataset column of datetime to date only? i only wan to show the date only without any specific format. example, 1/25/2010 12:00:00 AM to 1/25/2010, without doing a .ToString('M/d/yyyy'). because im following the culture set in the web.config.
I have a class with properties for stuff like FileNumber, OpenedDate, ClosedDate etc.When I Initialise the class I set the datetime variables to Date.MinValue.Then when I populate my textboxes I check if the value of the date variables are Date.Minvalue and I set the textbox text to an empty string.
Code: If(File.OpenedDate = Date.MinValue, String.Empty, File.OpenedDate.ToString("yyyy/MM/dd")) However whe I try to save the data to my sql server db I get a datetime out of range error. What is the correct way to handle these null values in my date columns?
I 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.
Got 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.
I 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 am developing a C# VS 2008 / SQL Server 2005 Express website application. I have tried some of the fixes for this problem but my call stack differs from others. And these fixes did not fix my problem. What steps can I take to troubleshoot this?
System.Data.SqlClient.SqlException was caught Message="Conversion failed when converting datetime from character string." Source=".Net SqlClient Data Provider" ErrorCode=-2146232060 LineNumber=10 Number=241 Procedure="AppendDataCT" Server="\\.\pipe\772EF469-84F1-43\tsql\query" State=1 StackTrace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at ADONET_namespace.ADONET_methods.AppendDataCT(DataTable dt, Dictionary`2 dic) in c:Documents and SettingsAdminMy DocumentsVisual Studio 2008WebSitesJerryApp_CodeADONET methods.cs:line 102 And here is the related code. When I debugged this code, "dic" only looped through the 3 column names, but did not look into row values which are stored in "dt", the Data Table. public static string AppendDataCT(DataTable dt, Dictionary<string, string> dic) { if (dic.Count != 3) throw new ArgumentOutOfRangeException("dic can only have 3 parameters"); string connString = ConfigurationManager.ConnectionStrings["AW3_string"].ConnectionString; string errorMsg; try { using (SqlConnection conn2 = new SqlConnection(connString)) { using (SqlCommand cmd = conn2.CreateCommand()) { cmd.CommandText = "dbo.AppendDataCT"; cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = conn2; foreach (string s in dic.Keys) { SqlParameter p = cmd.Parameters.AddWithValue(s, dic[s]); p.SqlDbType = SqlDbType.VarChar; } conn2.Open(); cmd.ExecuteNonQuery(); conn2.Close(); errorMsg = "The Person.ContactType table was successfully updated!"; } } }
I created a UserControl and added a public DateTime property. I want to set this property in Markup (ie. <cc1:MyControl runat="server" id="MyControl1" DateTimeProp="1/1/2010" /> ) however I live in a place with a dd/mm/yyyy date format so it complains if I set something like "20/1/2010". Is there a way to set markup in my local datetime format or do I have to conform to "mm/dd/yyyy"?
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.