Coder Social home page Coder Social logo

yii2-amcharts's Introduction

yii2-amcharts

http://www.amcharts.com/

To install, either run

$ php composer.phar require --prefer-dist mitrm/yii2-amcharts "dev-master"

or add

"mitrm/yii2-amcharts": "dev-master"

Example: Displays a pie

$chartConfiguration = [
    'dataProvider' => [
		['author' => 'Вася', 'title' => 'Васильев Вася', 'count' => 5],
		['author' => 'Олег', 'title' => 'Васильев Олег', 'count' => 15],
	
	],
    'type' => 'pie',
    'legend' => [
        'markerType' => 'circle',
        'position' => 'right',
        'marginRight' => 30,
        'autoMargins' => false,
        'labelWidth' => 310,
        'labelText' => '[[title]]',
        'valueText' => '[[value]] ([[percents]]%)',
        'width' => 390,
    ],
    'maxLabelWidth' => 150,
    'marginLeft' => -100,
    'marginTop' => 0,
    'marginBottom' => 0,
    'labelText' => '[[value]] ([[percents]]%)',
    'valueField' => 'count',
    'titleField' => 'title',
    'descriptionField' => 'author',
    'balloonText' => '[[title]]<br><span style=\'font-size:12px\'><b>[[value]]</b> ([[percents]]%)</span>',
];
echo mitrm\amcharts\AmChart::widget([
    'chartConfiguration' => $chartConfiguration, 
    'options' => ['id' => 'chart_id'],
    'width' => '100%',
    'language' => 'ru',
]);

yii2-amcharts's People

Contributors

mitrm avatar

Watchers

 avatar  avatar  avatar

Forkers

cybercog

yii2-amcharts's Issues

Invalid path alias

hello and thanks a lot for this extension.
I used this extentsion but I offer to change this line of your code
public $sourcePath = '@/mitrm/yii2-amcharts/assets';

to
public $sourcePath = '@vendor/mitrm/yii2-amcharts/assets';
for this error
Invalid path alias: @mitrm/yii2-amcharts/assets

theme configuration

Hello again.
by adding theme in configuration any changes don't apply.

I think it has a problem?
public function addThemeJs($theme)
{
$this->js[] = 'themes/' . $theme . '.js';
}

may be a change like this:
public function addThemeJs($theme)
{
$this->js[] = 'amcharts/themes/' . $theme . '.js';
}

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.