Click here to Skip to main content
15,996,462 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Sir,

i have file consist
km   tower no
117  0
450  1
432  2
350  3
250  4

...
this the span of kilometer between each tower.
means
towerno      km
0            117
1            562
2            994
3            1042
4            1292
....

no i have problem i plotted the graph i want to add this series to existing chart which is plotted against kilometer.
the existing chart file is
km    fault
0        8
1        2
3        5
4        6
5        5
6        1
......


Please help me i was able to plot the chart but i am not able to plot tower no not even in tooltip.
1.how do i plot in same graph.
2.Or can i super impose 2 chart areas by making transperent.

What I have tried:

VB
Public Function ChartOpen(ByVal path As String, ByVal A As System.Windows.Forms.DataVisualization.Charting.Chart) As String
        For Each line As String In IO.File.ReadAllLines(path)
            A.Series(0).ToolTip = "Open"
            Dim points() As Double = Array.ConvertAll(line.Split(" "c), Function(s) CDbl(s))
            A.Series(0).Points.AddXY(points(0), points(1))
            A.Series(0).ToolTip = "kM = #VALX" & vbCrLf & "Fault = #VALY"
        Next

    End Function
   Public Function ChartTower(ByVal path As String, ByVal A As System.Windows.Forms.DataVisualization.Charting.Chart) As String
        For Each line As String In IO.File.ReadAllLines(path)
            line = line & " 2"
            A.Series(2).ToolTip = "Tower"
            Dim points() As Double = Array.ConvertAll(line.Split(" "c), Function(s) CDbl(s))
            A.Series(2).Points.AddXY(points(0), points(1))
            A.Series(2).ToolTip = "kM = #VALX"
        Next

    End Function
Posted
Updated 20-Apr-18 19:01pm
v3
Comments
Ralf Meier 21-Apr-18 15:28pm    
I don't understand ...
1st : What is your code doing (which result do you get) and what are you awaiting (which result do you want to get) ?
2nd : the 2 exercise (for me) should be displayed in different charts - not in the same chart in different series ...
Member 13307200 23-Apr-18 0:41am    
Sorry sir,
I want to plot graph in same chart with different series.
But problem is in y axis i have taken index(which kilometer) n x axis for fault for chartOpen Function.
Now i want to plot the chart for tower. y axis should consist of tower no and also km(means tower no should be place on respective span ). i dont have x axis value... variables of file i have quoted above..
1. My code will take file as input and chartname as input. then reads each line and plot..
2. if it is not possible then i am trying to super impose two chart and baground of one chart transperent so that it should nor coflict.
(i dont know it is correct or not).

My output in toolTip should display, for first series KM= 89, Fault =4
and for second series should display KM = 89 , Tower_no =260.

Hope with my bad English u understand my problem
Ralf Meier 23-Apr-18 8:10am    
I don't have a problem with your english ...
Please explain :
What do you get ?
What do you want to get ?
Ralf Meier 23-Apr-18 14:25pm    
Additional :
I mean :
How does your Chart look after importing the data with your Code ?
And :
How should it look ?
Member 13307200 24-Apr-18 0:10am    
https://drive.google.com/open?id=183TjajGsVXOynIZcmw8PvsE_KUWItU_d


https://drive.google.com/open?id=1M5utRuDlfa-VbYih9NLtUXsv0RnOAsWO

these are attachemnts how chart looks
now green column is tower is only displaying kilometer. i tried one more dot chart to display tower no. with violet but it is not looking good
i want only green column should display tower no and its km

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900