mschart

Gap between the first X datetime value and the Y axis

最后都变了- 提交于 2019-12-12 05:39:32
问题 In my application, I use mschart to display data using a x axis with datetime value and an Y axis with numeric (double) values. However, I have noticed that there is a small gap between the Y axis and the first X value: Is there a way to force the graph to start exactly on the Y axis? EDIT: Here is what I use to populate my series: foreach (AggregatedValue value in line.Value) { series.Points.AddXY(value.TimeStamp.ToLocalTime(), value.Value); } Aggregated value is a class containing the 2 x,

How To Bind A DataTable To MS Chart

…衆ロ難τιáo~ 提交于 2019-12-12 04:34:55
问题 this is myCode: private void frmChart_Load(object sender, EventArgs e) { string cs = ConfigurationManager.ConnectionStrings["dbcs"].ConnectionString; using (SqlConnection Con = new SqlConnection(cs)) { SqlCommand cmdSum = new SqlCommand("Select distinct(UserName),sum(Value) from mytable group by UserName",Con); Con.Open(); SqlDataReader reader = cmdSum.ExecuteReader(); chart1.DataBindTable(reader,"sum(Value)"); } foreach (Series series in chart1.Series) { series.CustomProperties =

MS Chart, X axis dates and cursor interaction when X value is indexed

ε祈祈猫儿з 提交于 2019-12-12 04:24:26
问题 Good afternoon, Wow what a title. Basically here is the thing. If have a time series which is not continuous. Hence, since I use the IsXValueIndexed property of the Series (set to true) to collapse the space between the separate points. That works fine, however I would now like to be able to recover a point's detail in from the graph (X and Y values) and display them in a label on the form. Hence, I use the following event: void myChart_CursorPositionChanging(object sender, CursorEventArgs e)

MsChart Add Multiple Series from Database

岁酱吖の 提交于 2019-12-12 03:08:17
问题 I want to add different line chart one at the time to my chart. So i have a textbox with a button . i input a code and load the series from my database. The problem is that the new line series override the old line series. so i decided to keep tract of the added series into a gridview, i loop through it and fill the chart; same result. This is my code void AddSerie(string stockName) { try { Legend legend = new Legend(stockName); Chart1.Legends.Add(legend); Series series = new Series(stockName

How to zoom secondary y axis in mschart

一世执手 提交于 2019-12-11 19:54:01
问题 I am making a plot which has both primary and secondary y axis but on zooming the chartarea only primary x axis and primary y axis are zooming and the scrollbar doesn't appear on the secondary Y Axis chrtarea.CursorX.IsUserEnabled = true; chrtarea.CursorX.IsUserSelectionEnabled = true; chrtarea.CursorY.IsUserEnabled = true; chrtarea.CursorY.IsUserSelectionEnabled = true; chrtarea.AxisX.ScaleView.Zoomable = true; chrtarea.AxisY.ScaleView.Zoomable = true; chrtarea.AxisY2.ScaleView.Zoomable =

How to add zoom IN/ZOOM out functionity into chart control

耗尽温柔 提交于 2019-12-11 19:46:49
问题 I have created chart using microsoft chart control. Below is the stuff. <asp:Chart ID="dntdata" runat="server" Height="130px" Width="134px" Visible="false"> <Series> <asp:Series Name="Series1" ChartType="Doughnut" IsValueShownAsLabel="True" LabelForeColor="White" Font="Verdana,5pt"> <Points> </Points> </asp:Series> </Series> <ChartAreas> <asp:ChartArea Name="ChartArea1" Area3DStyle-Enable3D="True"> </asp:ChartArea> </ChartAreas> </asp:Chart> I need to add - ZOOM IN/ZOOM OUT functionality into

Chart in winform displaying wrong Point

人走茶凉 提交于 2019-12-11 10:30:04
问题 I have the following code. I have hardcoded the x and y values to test. And for some reason for the point (0,-0.5) it plots (1,-0.5) For the life of me I do not know what is going on, because if you try other values then the graph displays correctly. foreach (var grp in q) { point = new DataPoint(); Sum1 = grp.Sum1 > 2 ? 2 : grp.Sum1; Sum1 = Sum1 < -2 ? -2 : Sum1; Sum2 = grp.Sum2 > 2 ? 2 : grp.Sum2; Sum2 = Sum2 < -2 ? -2 : Sum2; point.XValue = 0; point.YValues = new double[] { -0.5 }; chart1

Adding text , image to asp.net chart control

故事扮演 提交于 2019-12-11 10:27:18
问题 I am using asp.net chart control to display chart on my website , below is the snippet of it: The issue is i want to add the text and an arrow line on each point , so for instance on the point (60,october) I want to write text at this point: projection was highest and an arrow image. Is it possible to acheive something like this, any suggestion or assistance will be highly appreciated, below is the code i have used to generate this chart: double[] yValues = { 15, 60, 12, 13 }; string[]

c# Winform MSChart reverse Y Axis

懵懂的女人 提交于 2019-12-11 04:09:50
问题 I am using the MSChart control on a Windows form. I am trying to have a descending Y axis by using AxisY.IsReversed = true , but still keep the X axis on the bottom. By default, when I used AxisY.IsReversed = true , then the X axis goes up to the top. I then tried the setting the AxisY.Crossing = Max to flip the axis to the maximum end of the Y axis (which is at the bottom) but it won't go below the X axis, it only goes as far as just above it. Please help me!!!!! 回答1: The behavior you

set labels on datapoints using mschart

前提是你 提交于 2019-12-11 04:05:53
问题 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 回答1: Datapoint has a label property that can be set programatically: DataPoint dp = new DataPoint(); dp.Label = c.Start.ToShortTimeString() + " - " + c.End.ToShortTimeString() + "\n" + c.Class; You can iterate through the datapoints in a series after databinding: foreach (DataPoint d in Chart1.Series[0].Points) { d.Label =