Skip to content

Commit 8278489

Browse files
Option to show legend on the left side #83
1 parent 41d0fb3 commit 8278489

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

classes/Visualizer/Render/Sidebar.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public function __construct( $data = array() ) {
9898

9999
$this->_legendPositions = array(
100100
'' => '',
101+
'left' => esc_html__( 'Left of the chart', Visualizer_Plugin::NAME ),
101102
'right' => esc_html__( 'Right of the chart', Visualizer_Plugin::NAME ),
102103
'top' => esc_html__( 'Above the chart', Visualizer_Plugin::NAME ),
103104
'bottom' => esc_html__( 'Below the chart', Visualizer_Plugin::NAME ),

js/render.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@
5353
}
5454
}
5555
}
56+
57+
if (settings.series && settings.legend && settings.legend.position == "left")
58+
{
59+
settings.targetAxisIndex = 1;
60+
}
5661
break;
5762
case 'geo':
5863
if (settings.region != undefined && settings.region.replace(/^\s+|\s+$/g, '') == '') {
@@ -87,6 +92,11 @@
8792
}
8893
}
8994
}
95+
96+
if (settings.series && settings.legend && settings.legend.position == "left")
97+
{
98+
settings.targetAxisIndex = 1;
99+
}
90100
break;
91101
default:
92102
return;

0 commit comments

Comments
 (0)