KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Legends position in line chart #401

Open mike opened this topic on on Jul 31, 2018 - 7 comments

mike commented on Jul 31, 2018

Hi , I have multiple legends and its around 10 I'm giving legends position bottom .

"legend"=>array(
    "position"=>"bottom",
    'textStyle' => array(
        'fontSize' => 13 ,
    ),
    'width' => '50%'
),

but its giving paging there

is there any way to show all legends in single page or if its can come in second or line by line

David Winterburn commented on Jul 31, 2018

Hi Mike,

There's an option called legend.maxLines but it unfortunately only works when when legend.position is 'top' as documented here: https://developers.google.com/chart/interactive/docs/gallery/linechart#configuration-options

KoolReport commented on Jul 31, 2018

May be you can try to set:

"legend"=>array(
    "maxLines"=>3,
    ...
)

It is the only option that I think would be applicable.

mike commented on Jul 31, 2018

this is not working out nothing has changed I set legend on top

                        "legend"=>array(
				"position"=>"top",
				 "maxLines"=>3,
			),
David Winterburn commented on Jul 31, 2018

Hi Mike,

Would you please post your whole php code for the chart here? Thanks!

mike commented on Jul 31, 2018

<?php

   LineChart::create(array(
            "dataStore"=>$this->dataStore('new_report'),  

    "width"=>"100%",
	"options"=>array(
			"responsive"=>true,
			"legend"=>array(
			"position"=>"top",
			 "maxLines"=>3,
			),
			'pointShape' => 'circle',
			'pointSize' => 5,
			'hAxis' => array(
				'textStyle' => array(
				'fontSize' => 11 ,
				"color"=> "transparent",
								),
						),
							 "scales"=>array(
        "xAxes"=>array(
            array(
                "sold_date"=>array(
                    "suggestedMin"=>$this->params["dateRange"][0],
                    "suggestedMax"=>10,
                )
            )
        )
    ),
					),
	

));

    ?>
David Winterburn commented on Jul 31, 2018

Hi Mike,

We tested the maxLines option successfully on our machine when legend's position is top. Can you set up an online link to your chart page so we could investigate the problem for you? In another approach, please remove most of your chart's options, keep only the legend position and maxLines to see if it works. Thanks!

mike commented on Jul 31, 2018

Thanks .. its working but name of legends are not display full on mobile view its display in ellipsi formate

it is so closed to chart need some margin

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None