lavacharts icon indicating copy to clipboard operation
lavacharts copied to clipboard

OrgChart is included but not enabled. Why?

Open Dimonka2 opened this issue 3 years ago • 1 comments

What Version?

3.1.14

Issue

Not sure why OrgChart is not enabled in ChartFactory::$CHART_TYPES = []? I just added it it to the list and it seems to work. Is there a special reason (except missing documentation) why it is excluded from factory?

Controller Code (chart creation code)

Here is an example of chart that is working after quick ChartFactory tweak:

        $lava = new Lavacharts; 

        $chart = $lava->DataTable();

        $chart->addStringColumn('Title')
            ->addStringColumn('Parent')
            ->addStringColumn('Tooltip');

        $chart->addRow([['v' => 'Test', 'f' => 'Test<br /> <span class="text-danger">n = 100</span>'], '', 'Some test tooltip']);
        $chart->addRow([['v' => 'Test2', 'f' => 'Test 2<br /> <span class="text-success">n = 50</span>'], 'Test', 'Some test tooltip 2']);
        $chart->addRow([['v' => 'Test3', 'f' => 'Test 3<br /> <span class="text-primary">n = 45</span>'], 'Test', 'Some test tooltip 3']);

        $lava->OrgChart('Chart', $chart, [
                'allowHtml' => true,
            ]);

Thanks!

Dimonka2 avatar Jul 16 '21 08:07 Dimonka2

You must have found an oversight by me! If you could make a quick PR out of the fix I will merge it.

kevinkhill avatar Jul 24 '21 14:07 kevinkhill