locked
bar chart problem in asp.net chart control

    Question

  • 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....

    mercredi 7 mars 2012 12:30

Réponses

  • 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.

    • Marqué comme réponse mridulcs mercredi 7 mars 2012 13:13
    mercredi 7 mars 2012 12:59
    Modérateur

Toutes les réponses

  • Use a Range Bar Chart for each of the series.
    mercredi 7 mars 2012 12:54
    Modérateur
  • but i placed 3 range bar but all these 3 bars started from 0..please help by codes.
    mercredi 7 mars 2012 12:55
  • 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.

    • Marqué comme réponse mridulcs mercredi 7 mars 2012 13:13
    mercredi 7 mars 2012 12:59
    Modérateur
  • 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

    mercredi 7 mars 2012 13:12
  • 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.

    mercredi 7 mars 2012 13:38
    Modérateur
  • 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.

    dimanche 11 mars 2012 11:18
  • 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.

    lundi 12 mars 2012 14:15
    Modérateur