Yanıt bar chart problem in asp.net chart control

  • 07 Mart 2012 Çarşamba 12:30
     
     

    hello asp.net chart creators,

    plz help see the below image the second %value bar series will not start from 0...how will i make 

    this kind of chart where 2nd and 3rd bars will start from a datapoint not from 0 and end will a datapoint ?

    plz reply....

Tüm Yanıtlar

  • 07 Mart 2012 Çarşamba 12:54
    Moderatör
     
     
    Use a Range Bar Chart for each of the series.
  • 07 Mart 2012 Çarşamba 12:55
     
     
    but i placed 3 range bar but all these 3 bars started from 0..please help by codes.
  • 07 Mart 2012 Çarşamba 12:59
    Moderatör
     
     Yanıt Kod İçerir

    A range bar needs two y values for each x value. For example:

    Chart1.Series(0).Points.AddXY(1, 2, 3)

    Have a look at the Samples Environment for chart control basics.

    • Yanıt Olarak İşaretleyen mridulcs 07 Mart 2012 Çarşamba 13:13
    •  
  • 07 Mart 2012 Çarşamba 13:12
     
      Kod İçerir

    so if my data point was like that -

    <asp:DataPoint YValues="40" AxisLabel="companyname1" />

    then

    Chart1.Series(0).Points.AddXY("companyname1", 20, 40) is same as above data point ? in sample environment i did not find range bar example

  • 07 Mart 2012 Çarşamba 13:38
    Moderatör
     
      Kod İçerir

    This:

    Chart1.Series(0).Points.AddXY("companyname1", 20, 40)

    is the same as:

    <asp:DataPoint Axislabel="companyname1" YValues="20,40" />

    The Range Bar example is in the Samples Environment under Content > Chart Types > Range Charts > Range Bar Charts.

  • 11 Mart 2012 Pazar 11:18
     
     

    hi Sipla and every1

    i created rangebar the way was said above posts...i set YValues and label from code behind but the label of the bar is shown at the middle of the bar not at right of bar! please reply i want to show labels at right side of range bar.

  • 12 Mart 2012 Pazartesi 14:15
    Moderatör
     
      Kod İçerir

    Use the BarLabelStyle custom property to specify the position of the label.

    Chart1.Series(0)("BarLabelStyle") = "Outside"

    Note that the label will appear on the left side of the bar if Y1 is bigger than Y2.