How To Get Line Chart With Scaled Dates On X Axis

Mar 7, 2010

There are plenty of references on the Internet on MSChart (AxMSChart)for Visual Basic 2008, but the published code seems to have all sorts of problems. I am a novice and trying to get a line chart with scaled dates on the x-axis.

View 1 Replies


ADVERTISEMENT

RDLC Chart - Produce A Chart Showing The Month Along The Y-axis And The Value Up The X-axis

Jan 8, 2009

I have the smallest dataset in the world that simply consists of a month (text) and and amount. I want to produce a chart showing the month along the y-axis and the value up the x-axis. How do I do it? I have dragged the chart control onto the report page and populated the dataset. The chart shows but nothing like what I would expect. Just to make it simple I populated the dataset with an amount equivalent to the month number so it should show as 1 in January, 2 in Feb etc...However no matter where I drag the dataset's column names I don't get what I want. Where am I going wrong?

I use this simple loop to populate the dataset:

dsSales.Tables("Sales").Clear()

For i As Integer = 1 To 12
dsSales.Tables("Sales").Rows.Add(MonthName(i), i)
Next

ReportViewer1.RefreshReport()

I get this as a result:

View 1 Replies

.net - MS Chart With ASP.NET Chart Type "column" Not Showing Axis X Label?

Mar 12, 2010

I'm having problem with MS Chart chart type column. If there are only 9 bar in the chart like the following picture, then the axis-x label show up properly.

However, there are more than 9 bars bar the chart, the axis-x label wont show up properly, some of them just dissappear.

Here's my mark-up for the chart:

<asp:Chart ID="chtNBAChampionships" runat="server">
<Series>
<asp:Series Name="Championships" YValueType="Int32" Palette="Berry"

[Code]....

I don't know it works with only 9 bars? Is there any way to make the chart work properly? Also, if possible, how to make each bar have different color.

View 4 Replies

.NET Chart Y-axis Scaling?

May 13, 2011

I am using the MSChart object in VB2010. Live futures data is put into an array, then added one point at a time to a line chart (Chart1, one line only) using (1):

frmChart2.Chart1.Series("data").Points.AddXY(sec10, spreadarray(0, sec10))

All fine and good. However, by the time a few thousand data points have come through, its getting hard to see the detail in the chart, therefore I reset the x-axis so that I just see the last 200 (say) points, using (2):

Chart1.ChartAreas("ChartArea1").AxisX.Minimum = frmPrices.sec10 - CLng(lstChartpts.Text)

...where frmPrices.sec10 is the total number of data points, and CLng(lstChartpts.Text) is the number of points required. So if I have 1000 pts, and I wish to see 200 displayed, the AxisX minimum in this case is 1000 - 200 = 800. Points then start to build again one at a time. I am happy with this except that the Y-axis scaling is still taking into consideration all 1000 data values, so need to reset the Yaxis maximum and minimum. No problem (3):

Chart1.ChartAreas("ChartArea1").AxisY.Maximum = (max of the last 200 values + a small increment)
Chart1.ChartAreas("ChartArea1").AxisY.Minimum = (min of the last 200 values - a small increment)

The problem comes in when I want to change the number of points to display back to "ALL". I could re-write the code to use the max and min of all values, as in (3), but I'd rather just reset the yaxis back to the autoscaling that the chart started out with. I've looked everywhere for a property or method to do this! Or is there a way to autoscale the yaxis according to only the displayed values?

View 8 Replies

Assigning Array To X Axis Of MS Chart?

Feb 21, 2012

I have Date and Time available in xaxis() array format. I would like to assign this to x axis of the MS Chart. My all other data is in datatable format and already have assigned series to this values.Chart1.Series(0).Points.DataBindXY(xaxis, yaxis).. but it gives me error as i do not have valid values for y axis.

View 2 Replies

Bar Chart - Y-axis Should Still Be Divided Into 10 Intervals?

Dec 28, 2009

I am busy with a routine that will draw a bar chart.The X-axis is from 0 -100, no problem. The problem is the Y-axis.it will range from 0 to whatever the highest y-value will be.

My problem is that the y-axis should still be divided into 10 intervals, and the lenght of my y-axis should be the same in my picture box.I am using an array to fill the values, chartdata (0-9). It gets 10 values from the program. the values are 0 -10, 11 -20,21-30....91-100 . here is the code. It is working, but my Y-axis is messed up. Printing the labels of the y-axis is a problem.

Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
Dim chartData() As Single = {mark0, mark10, mark20, mark30, mark40, mark50, mark60, mark70, mark80, mark90}[code]......\vb

View 9 Replies

Chart: Sorting Axis By Date?

Jun 8, 2011

Using the System.Windows.Forms.DataVisualization.Charting objects/namespace, am having problems getting by chart to sort axis of dates properly.My data looks like this (dates in US format):

Product Quantity SaleDate
A -- 2 -- 5/1/2011
B -- 1 -- 5/1/2011
C -- 1 -- 1/1/2011
B -- 2 -- 2/1/2011

I'm creating a stacked column graph like this, where dv is a dataview of the datatable:

vb.net
chSales.DataBindCrossTable(dv, "Product", "SaleDate", "Quantity", "") chSales.AlignDataPointsByAxisLabel() For Each cs As Series In chSales.Series cs.ChartType = SeriesChartType.StackedColumn cs.YValueType = ChartValueType.Int32 cs.XValueType = ChartValueType.DateNext

So this produces a stacked column graph with 2 A's, 1 B in May 11, etc But the date order is Feb, Jan, May, regardless of how I sort the datatable provided to the chart.

View 7 Replies

VS 2008 Setting Min/max X And Y Axis In MS Chart?

Mar 24, 2009

I'm trying to set the minimum and maximum x and y axis for a chart.I'm using the next

Private Sub Chart_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
frmMenu.Enabled = False

[code].....

View 12 Replies

Assign Values To X / Y Axis In Chart Spline

Oct 28, 2009

I am working on simple handover process from one mobile station to other. I got three proposed results service disruption time, network entry time, connection set up time. I also have the result of these three as by using some conventional way and got improved these three delay results by proposed way. Results are store in textboxes. Now i want to show graphically. E.g. I want to show conventional service disruption time on x axis and proposed service disruption time on y axis or vice versa. Let suppose I want to have a scale on axes from 1 to 3000 milliseconds. Then I want to show how purposed scheme is better. I am using VB.Net 2008.I have created chart. I also studied MS chart for windows forms samples environment. Also applied different chart properties like titles, series and others, But I am not able to make x and y axes scales. How to get values on the axes and how to generate graph? [code]

A chart element with the name '0' could not be found in the 'ChartAreaCollection'.i also tried using ChartAreas(Default") but i am getting same idea.I don't get what for this chartAreas value in parenthesis is used.

View 1 Replies

Primary X Axis In MS Chart Control Won't Display Max Value?

Jul 21, 2011

I am using MS chart control .net 4 framework in Visual studio 2010 using Windows forms. I am having an issue with the scale of the primary x axis on a user input from a text box on a button click. I am also using both the primary and secondary y axes which work on a user input.

I have checked the settings for each axis and they all have the same settings. I don't see why both y axes work on the user input and the x does not.

The following is the code I am using:

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Chart1.ChartAreas("Area1").AxisX.Minimum = Val(XPrimeMin.Text)

[Code].....

View 1 Replies

Force MS Chart Control To Not Use Decimals When Stepping Axis?

May 9, 2012

I have a data point with a y-value of 1 being plotted, the MS Chart control will use increments of 0.2 on the y-axis. How can I force it to not use a decimal, keeping in mind I will have values of >100 so I can't just force an increment of 1 on the y-axis?

View 1 Replies

Chart X Axis Labels - Label Display Is Inconsistent - VS 2010

Aug 2, 2011

I'm seeing a strange problem with the labels on the X axis of my charts. I've setup two chart areas and aligned them (which displays fine) and the user can manipulate the chart by selecting different date resolutions (Year, Month, Day, Week, Hour) and different time periods.

The issue I'm seeing is that if a user selects say Months as the date resolution the X axis label display is inconsistent. If a fairly broad range for the dates is selected the X axis displays absolutely fine but as the date range narrows the X axis starts to duplicate labels ( please see the attached images). The second Image had a date range of 1st of May to 1st of August and as you can see the labels are duplicated. This is my first go with the chart control so I could be missing something basic. [Code]

View 1 Replies

VS 2008 MSChart - Chart Area Axis's Aren't Drawn When No Data Plotted

Apr 2, 2009

MS released the new MSChart for .net 3.5 sp1. I'm trying to get the hang of it in VS2008. One big issue I have is that if I have no data plotted the chart area axis's aren't drawn. Does anyone know a way around that? That seems like a pretty basic/common issue.

View 6 Replies

C# - MS Chart Customize Value Label And Draw Line Series Across The Chart Area

Aug 25, 2010

I'd like to get suggestion in both C# and VB.NET I created Chart like the following image:

[Code]....

View 1 Replies

Get The Angle Of A Line In Relation To The X Axis?

Apr 18, 2011

i am trying to get the angle of a line in relation to the x axis. The line is being drawn in a picturebox. So its the Upper right quadrant of the cartesian plane ... but its flipped over the x axis.im using this code

a=pt(1).x
b=pt(1).y
c=pt(2).x
d=pt(2).y

z=math.atan2((c-a),(d-b))*(180/math.pi)

The issue is that the line im drawing is almost parallel to the x axis but its returning a value of roughly 90 degrees .It seems like it is giving me the angle in relation to the y axis, but not being super good at the math myself im not exactly sure what to change here.

View 6 Replies

Formatting Axis Labels Based On Axis Label Values?

May 22, 2012

I have a P/L chart which has a left scale (Y axis) which starts from a negative value. I want to format the axis labels (the major tick mark labels) so that the negative ones are red.
Something like;

If cht.ChartAreas(chtarea).AxisX.MajorTickMark.Value < 0 Then
cht.ChartAreas(chtarea).AxisY.LabelStyle.Font = New Font("Verdana", 9.0F, FontStyle.Bold, Color.Red)

[Code]....

Of course that doesn't work since MajorTickMark doesn't have a value property. How does one make this work?

View 1 Replies

Refresh - Program, Draws A Rectangle, Marks The X & Y Axis, & Plots A Dashed Line Grid

Dec 16, 2009

This is simple program, draws a rectangle, marks the x & y axis, & plots a dashed line grid. However, the grid sub has to be called twice - only then will the grid line be visible. Why does this happen?

CODE:

View 1 Replies

Mouse Hook In X-axis And Y-axis Coordinates?

Aug 14, 2011

I am having trouble in getting the coordinates of x-axis and y-axis in low level ouse hook...all I am getting is values in x-axis listbox and in y-axis listbox I am getting zeros......why? and my second problem is I am calling the setcursorpos
function in a for loop because I want to automate mouse movements and clicks, but setcursorpos function is not working , maybe because I am getting the coordinates wrong.....here is my code

low level mouse hook

Public Class MouseAutomating
Inherits HotKey
Public lstbox As New ListBox

[code]...

View 4 Replies

VSTO - Excel Chart, Subtitle For Chart - Access Chart Text Box From Code?

Oct 14, 2011

I have a chart in Excel that I'd like to use a subtitle on. There is no SubTitle Property on the chart object, so I looked in the Excel User interface and found that you can only create a sub-title by using a text box. The text box looks like its associated with the chart, not the worksheet, so how would I access that text box from code?

View 1 Replies

How To Create A Line Chart

Aug 29, 2009

I need to display a line chart which i retrieve data from the database in Visual Basic 2005.How to create a line chart in Visual Basic 2005? is it possible? if possible, can anyone teach me how to create.

View 4 Replies

Line Chart Of An Array

Dec 9, 2010

I am using VB express 2010 and I have the following problem: I would like to make a line chart of an array.For example: the daily mean temperatures (Temp(365)) and in the x-axis the date.Do I use the chart option of the toolbox? And how do I link this to my data? Or is it better to program everything myself? How do I start?

View 2 Replies

Excel - Code In VBA And Recording A Macro - Input A Values For The X Axis Rotation And The Y Axis Rotation

Sep 16, 2009

I am having some major problems with the code in VBA and recording a macro didn't get me anywhere nor is the VBA help file. I have to have it so that I can input a values for the x axis rotation and the y axis rotation so that my 3d surface graph will rotate whatever values I input, the 3d surface graph will rotate those degrees. I also have to have a method for having the default rotation. I was also wondering how to put scroll bars for the x and y rotation. The only other thing I am having trouble with is having an input to check box for right angle axes. So far I have two cells for entering the x rotation value and the y rotation value. I also already have my 3d surface graph.

View 3 Replies

.net - ASP.NET With MS Chart Disable The Vertical Line

Mar 11, 2010

I have a graph created with MS Chart like the following picture. As you can see the vertical lines are messed up with value of the top of each bar.


Here's the mark-up for the graph:

<asp:Chart ID="chtNBAChampionships" runat="server">
<Series>
<asp:Series Name="Championships" YValueType="Int32" ChartType="Column" ChartArea="MainChartArea" IsValueShownAsLabel="true">

[Code].....

I don't want the display the vertical line because it's messed up with the value on top of the each bar. How can I disable the vertical line?

View 3 Replies

C# - Line And Points Using Asp.net Chart Control?

Jul 15, 2010

I have data in data table like below.

I am trying to make graph like below using asp.net chart control (made graph in excel with some test data)

points are X and Y values. lines are linear, exponential, logarithmic and power values.

So how can I make this chart in asp.net (vb.net or c#)?

View 1 Replies

Change Width Of A Line Chart?

Dec 15, 2010

Is it possible to change the width of a line series with the chart bundled in .net 4?

View 3 Replies

Line Chart From Text File?

Mar 23, 2011

I have a log file that is saves data every day, each day new data is append to a new line of this log file. I will show you what this log file kind of looks like.Each log file line has 4 parts of data separated by commas.

03-01-2011,4.05,87,141
03-02-2011,4.10,88,138
03-03-2011,4.17,90,135
03-04-2011,4.20,86,115
03-05-2011,4.25,84,126
03-06-2011,4.31,81,132
03-07-2011,4.35,82,109
03-08-2011,4.42,78,136
03-09-2011,4.47,86,110
03-10-2011,4.53,83,108

I just need my chart to load this log file and loop through it and populate my line chart.I am able to make a line chart and populate it from a text file but only in a long way. I first load all the data to 10 text boxes, then I split all the data into 40 other text boxes then I use that to populate the chart, There has to be a easier way of doing this. With my current way I can only load up 10 days of data.I would like to be able to load up 30 days of data or even a years worth (365 entry's).I am using visual basic 2008 with .NET Framework 4 Chart Controls.[code].....The Date has to be at the bottom of this chart (going left to right) and the numbers on the left side.

View 7 Replies

Make A Line Chart For Program?

Jan 14, 2011

I want to make a line chart for my program.I will be sending values through serial COM and i would like to present these values to a line chart. So the chart is going to be 'live' and refreshing every few seconds.Could you provide any tutorial cause i dont know where to begin.

View 11 Replies

Take XML Data And Create A Line Chart With It?

May 18, 2009

I have a program written in VB6/VB.net and its supposed to calculate a set of numbers based on user input. From there the data is saved into an xml file. I want to be able to take the data from the xml file and draw a chart representing all the data. I found a tutorial that draws line graphs based on an predetermined array of data, but I need the program to take the data from an xml file.

Heres the code for the line drawing program:

Option Strict On
Imports System.Drawing.Drawing2D
Public Class ViewChart

[Code]....

View 11 Replies

Using The Chart Component For A Line Graph?

Aug 7, 2010

I have a series of x and y co-ordinates that I would like to plot on a line graph. Can anyone recommend any simple tutorials that would get be started?I have my chart component on the form, I'm guessing that I need to declare a collection of datapoints and loop through the adding each to the graph

View 5 Replies

VS 2010 Dynamic Line Chart?

Aug 28, 2011

I know how to do a simple graph on VS.I have a value in a textbox wich is updated every second and I need the chart to display that value on the chart every second with the last 5 values or so.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved