Results 1 to 3 of 3

Thread: Pie chart only have Y max used from each series - how?

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2018
    Posts
    10

    Pie chart only have Y max used from each series - how?

    Hi, I have 3 or 4 series which are fine in column and line graphs. But when I move to pie chart its unusable so I want to just use Ymax value from the series so I only have 3 or 4 segments. The last Y value in the series is the max but I cant work out how to just have this in the series or tell pie chart to just display max or last datapoint. When the user moves to line/column the series is reloaded. Any advice please?

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,413

    Re: Pie chart only have Y max used from each series - how?

    Post your code attempt, and we can help to improve it...

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2018
    Posts
    10

    Re: Pie chart only have Y max used from each series - how?

    HI, I have tried 2 things from searching around so far.
    1 - Find max approach from each series and then clear and try and add that value into an empty series - Error you can only add 1 value to a series - (i am only adding 1)
    Code:
          MaxPoint = TechAnalTopLeftGraph.Series(0).Points.FindMaxByValue()
                    TechAnalTopLeftGraph.Series(0).Points.Clear()
                    TechAnalTopLeftGraph.Series(0).Points.AddXY(MaxPoint)
    2 - Try and just load in the row with the value but this doesnt display anything but no errors reported
    Code:
                sub_range = Int(ASB_Tech_Anal_Inf_Delay_Time.Text) + 1
                'range_holder = "Select * from [Delay$A1" & ":j" & sub_range & "]"
                range_holder = "Select * from [Delay$A121:j121]"
    
                ' The code to follow uses a SQL SELECT command to display the data from the worksheet.
                ' Create new OleDbCommand to return data from worksheet.
                ' change range 
                'Dim myCommand As New OleDbCommand("Select * From [Edit$h1:u601]", myConnection)
    
                Dim MaxPoint As DataPoint
    
                Dim myCommand As New OleDbCommand(range_holder, myConnection)
    
                ' create a database reader    
                Dim myReader4 As OleDbDataReader = myCommand.ExecuteReader  '(CommandBehavior.CloseConnection)
                ' Populate the chart with data in the file
                If TopLeftCriticalSelect.Checked = True Then
                    TechAnalTopLeftGraph.Series(0).Points.DataBindXY(myReader4, "Time seconds", myReader4, "Critical_Total")
    Its only if a user selects pie chart that I wont to play with the series.
    Any help welcomed.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width