Home Forums WinForms controls Xceed Chart for WinForms Problem in x axis

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18759 |

    Hi,

    I am using the chart componet for .net
    I want to bind it with the sql server databse having 2 values-
    TestRun (1,2,,3,4,5,6) for x axis
    Read rate- y axis

    In my output i can see the readrate bounded correctly to y axis
    but x axis is not
    I have set x axis scale
    AutoMax -False
    AutoMin -False
    Max-10
    Min-1
    custom steps -1
    Major tickmode-manual(with collection-1,2,3,4,5,6,7,8,9,10)
    MaxTickCount-9
    origin-0
    useorigin-false

    I shows the first bar out (penetrating out the the left 3d wall)and rest bars are ok.How to bind x axis
    Pl help me.

    Thx

    Imported from legacy forums. Posted by shilpi (had 4405 views)

    User (Old forums)
    Member
    Post count: 23064

    You need to set the Min value to -1, so that the first bar, which is displayed at point 0, will be displayed as if it was on point 1.

    Imported from legacy forums. Posted by André (had 229 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks for ur help.Now one problem is solved(the first bar is displayed within the walls)
    but I want my x axis to start from 1 to 10 and not from 0 to 10.
    How should i do that?

    Imported from legacy forums. Posted by shilpi (had 337 views)

    User (Old forums)
    Member
    Post count: 23064

    You have two choices.

    First, set the AutoLabels property to false, and feed your own labels to the chart for every data point you’re adding. Only add an empty string at the begin, so the displayed labels will start where your first bar appears.

    e.g.

    chart.Axis( StandardAxis.PrimaryX ).NumericScale.AutoLabels = false;
    chart.Axis( StandardAxis.PrimaryX ).Labels.Add( “” );
    bar.Add( ReadRate )
    chart.Axis( StandardAxis.PrimaryX ).Labels.Add( TestRun );

    Second, you can use the default scale for BarSeries, that is, the DimensionScale. Set its AutoLabels property to false, and set the labels for every data point you are adding.

    chart.Axis( StandardAxis.PrimaryX ).DimensionScale.AutoLabels = false;
    bar.Add( ReadRate )
    chart.Axis( StandardAxis.PrimaryX ).Labels.Add( TestRun );

    Note however that if you use this last solution, you will not be able to set the Min and Max value of the axis.

    Imported from legacy forums. Posted by André (had 232 views)

    User (Old forums)
    Member
    Post count: 23064

    Sorry was busy with other stuff.Pl can u explain more clearly as i am using the chart editor
    and not the code.I repeat my problem again

    I have a sql table with 2 fields
    TestRun-values 1,2,3,4,5,6
    ReadRate-values 30,80,50,25,95,69

    i want to have a bar chart which has y axis as 0,10,20,30,40,50,60,70,80,90,100
    as x axis as 1,2,3,4,5,6….

    Please tell me how should i do

    Can i scroll also if i have more data
    thanks in advance

    Imported from legacy forums. Posted by shilpi (had 259 views)

    User (Old forums)
    Member
    Post count: 23064

    If you want to do this through the editor, you will need to find the equivalent properties in the editor, and set there values to what I have specified in the code snippet I provided.

    Imported from legacy forums. Posted by André (had 5192 views)

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.