GithubHelp home page GithubHelp logo

chart.js-php's People

Contributors

christof-b avatar ejdamm avatar hugoheneault avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

chart.js-php's Issues

Can not find folder vendor and autoload.php

Hi,

I tried to download this code. But get error : Warning: require(../vendor/autoload.php): failed to open stream: No such file or directory . I can not found folder vendor and autoload.php

thanks,

jajas

add thousand sparator to chart label

Hi,

i tried to add thousand separator to my chart but still got error. bellow is my code using callback function but it doesn't work. need your help for this issue.

$options = array(
'responsive' => true,
'callbacks'=>array(
'label'=>function (tooltipItems, data) (
return data.datasets[tooltipItems.datasetIndex].label + ' : ' + tooltipItems.yLabel.toLocaleString();
)
)
'scales' => array(
'yAxes' => array(
array(
'scaleLabel' => array(
'display' => $showYaxes,
'labelString' =>$yaxeslabel,
'fontSize' =>10,
'fontStyle'=>'bold',
'borderWidth'=>1,
),
'ticks'=>array(
'beginAtZero'=> true,
)

            )
        ),
        'xAxes'=> array(
            array(
              'gridLines'=>array(/*
                'zeroLineColor'=> "black",
                'zeroLineWidth'=> 2*/
                'display'=> true
              ),
              'ticks'=>array(
                'autoSkip'=>false,
                'maxRotation'=> 30,
                'minRotation'=> 30,                    
              ),
              'scaleLabel'=>array(
              'display'=> false,
              'fontSize'=>16,
              'labelString'=> $chartTitle
              )
            )  
        )
    ),
    'legend' => array (
        'display' => $displayLegend,
        'position' => $legendPos,
        'labels' => array (
        'fontSize' => 12,
        'usePointStyle'=> true,
        )
    ),
    'title'=>array (
        'display'=>true,
        'text'=> $chartTitle,
        'fontSize' => 12,
        'position'=>$titlePos

    )
);

Thanks,
Jajas

add Full

Hi,

I tried what you suggest to me for option in chart js, like bellow:
$options = array(
'scales' => array(
'yAxes' => array(
array(
'scaleLabel' => array(
'display' => true,
'labelString' => 'Time in Seconds',
'fontColor' => 'red'
)
)
)
)
);

and it woks. Thanks. buat i tried to add new option as follow to add legend but it does not work.

$options = array(
'scales' => array(
'yAxes' => array(
array(
'scaleLabel' => array(
'display' => true,
'labelString' => '',
'fontColor' => 'red',
'responsive' => false
)
)
)
)

'legend'=> array (
   'horizontalAlign'=>'left', // "center" , "right"
   'verticalAlign'=>'center',  // "top" , "bottom"
    'fontSize' =>'15'
 )

);

need your advice.

Cannot set border width

Hi,

I tired to set border width by set option bellow

                    array('data' => $data, 'label' =>'Jumlah')+$colors[$color_index], 'borderwidth'=>1,
                    );

Then i got this link : https://jsfiddle.net/kewmh8w0/ but confuse to implement in your code framework

Thanks in advance

Auto-generated data & options question/issue

This class is really helpful but I am doing view stats and some days there will be 0 views so how do i make it so that it does not just skip the date and says 0.

Here is an example in months of what i mean:
jan, feb, apr, jun, jul, aug, sep, nov, dec
it missed march,may & october so basically how to I make it so that it does not miss a few months and shows them as 0 instead of not showing them at all. Thanks

Also i have set it to always begin at 0 but for some reason it is not. Why could this be? Thanks

        $viewsGraph = [
            'labels' => ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
            'datasets' => [[
                'data' =>[8, 7, 8, 9, 6],
                'backgroundColor' => '#007bff',
                'borderColor' => '#005cbf',
                'label' => 'Weekly Views'
            ]]
        ];
        $options = [
            'responsive' => true,
            'scales' => [[
                'yAxes' => [
                    'ticks' => [
                        'beginAtZero' => true
                    ]
                ]
            ]]
        ];
        $attributes = ['id' => 'example', 'width' => 500, 'height' => 200];
        $Line = new ChartJS('bar', $viewsGraph, $options, $attributes);

This is the html side:


    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.bundle.min.js"></script>
    <script src="http://localhost/new/js/driver.js"></script>
    <script>
    (function() {
      loadChartJsPhp();
    })();
    </script>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.