Menu

rotate the name

austria
2016-01-24
2016-01-26
  • austria

    austria - 2016-01-24

    Hello
    I have my created image , unfortunately overlap down the names , how can I let down the names schaun or rotate the name ?
    best regards

    <?
    # PHPlot Example: Bar chart, 3 data sets, unshaded
    require_once 'phplot.php';
    $data = array(
    
    array('Vorname Nachname',   0,  1),
    );
    $plot = new PHPlot(1000, 550);
    $plot->SetImageBorderType('plain');
    
    $plot->SetPlotType('stackedbars');
    $plot->SetDataType('text-data');
    $plot->SetDataValues($data);
    $plot->SetTitle('Candy Sales by Month and Product');
    $plot->SetYTitle('Millions of Units');
    $plot->SetLegend(array('Einsätze', 'Übungen'));
    $plot->SetXTickLabelPos('none');
    $plot->SetXTickPos('none');
    $plot->DrawGraph();
    ?>
    
     
  • lbayuk

    lbayuk - 2016-01-24

    Hi, I tried your script I do not see any overlap of text. I see a title at the top, X and Y axis titles, and 2 lines in the legend. Is that the whole script? Is there perhaps more data?

     
  • austria

    austria - 2016-01-25

    Hello
    No there are about 42 entries

    <?
    # PHPlot Example: Bar chart, 3 data sets, unshaded
    require_once 'phplot.php';
    $data = array(
    
    array('Afflenzer    Matthias',  0,  1),
    array('Bertl    Johannes',  0,  1),
    array('Brandstetter     Claudia',   0,  0),
    array('Brenner  Christian',     1,  2),
    array('Brenner  Josef',     0,  2),
    array('Buchmann     Nina',  0,  0),
    array('Da Rin Fioretto  Oreste',    0,  0),
    array('Damböck  Karl',  0,  2),
    array('Eque     Christoph',     2,  2),
    array('Eque     Florian',   1,  2),
    array('Fellmann     Mario',     0,  0),
    array('Geni     Lucas',     0,  0),
    array('Grohs    Marco',     0,  1),
    array('Gubi     Tatjana',   1,  1),
    array('Heindl   Andreas',   2,  1),
    array('Herz     Mario',     1,  2),
    array('Hnilicka     Manuel',    0,  1),
    array('Holzapfel    Rainer',    2,  3),
    array('Holzapfel    Thorsten',  2,  2),
    array('Landauf  Emil',  0,  0),
    array('Mole     Sebastian',     0,  1),
    array('Müller   Christoph',     3,  2),
    array('Pahr     Daniela',   0,  1),
    array('Pahr     Hannes',    0,  0),
    array('Pahr     Melanie',   1,  0),
    array('Praschl  Alexander',     2,  2),
    array('Praschl  Nina',  0,  0),
    array('Rafferseder  Willy',     0,  1),
    array('Raitzl   Walter jun.',   4,  2),
    array('Schiller     Bruno',     4,  2),
    array('Schiller     Rene',  4,  2),
    array('Schmölz  Christian',     0,  0),
    array('Schnürer     Manuel',    0,  0),
    array('Schoisengeier    Daniel',    0,  3),
    array('Schoisengeier    Rainer',    0,  0),
    array('Schoisengeier    Stefan',    1,  1),
    array('Sonnleitner  Harald',    2,  1),
    array('Strohmeier   Michael',   0,  1),
    array('Toth     Christian',     1,  1),
    array('Uitz     Alexandra',     1,  2),
    array('Uitz     Gustav',    1,  0),
    array('Uitz     Sebastian',     1,  2),
    array('Weichselbaum     Gerald',    2,  2),
    array('Wimmer   Helmut',    0,  0),
    
    );
    $plot = new PHPlot(1000, 550);
    $plot->SetImageBorderType('plain');
    
    $plot->SetPlotType('stackedbars');
    $plot->SetDataType('text-data');
    $plot->SetDataValues($data);
    $plot->SetTitle('Candy Sales by Month and Product');
    $plot->SetYTitle('Millions of Units');
    $plot->SetLegend(array('Einsätze', 'Übungen'));
    $plot->SetXTickLabelPos('none');
    $plot->SetXTickPos('none');
    $plot->DrawGraph();
    ?>
    

    Friendly Greets

     

    Last edit: austria 2016-01-25
  • lbayuk

    lbayuk - 2016-01-25

    OK now it makes sense.
    Add this anywhere after 'new PHPlot' and before 'DrawGraph':

    $plot->SetXLabelAngle(90);
    

    Note that since you are using GD (fixed-font) text, your only choices for label angle are 0 or 90 degrees. If you switch to TrueType fonts, you can use any angle.

     
  • austria

    austria - 2016-01-26

    Thank you very much :-)

     

    Last edit: austria 2016-01-26

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.