Commit 100ea2c0 authored by Evgeny's avatar Evgeny

Add chart.axisY2 API

parent cad29fd8
...@@ -7971,6 +7971,14 @@ ...@@ -7971,6 +7971,14 @@
$$.redraw(); $$.redraw();
}; };
c3_chart_fn.axisY2 = function(value){
var $$ = this.internal;
$$.config.axis_y2_show = !!value;
$$.axes.y2.style("visibility", $$.config.axis_y2_show ? 'visible' : 'hidden');
$$.redraw();
};
c3_chart_fn.legend = function () {}; c3_chart_fn.legend = function () {};
c3_chart_fn.legend.show = function (targetIds) { c3_chart_fn.legend.show = function (targetIds) {
...@@ -8070,7 +8078,7 @@ ...@@ -8070,7 +8078,7 @@
} }
}; };
c3.chart.fn.turn = function(options){ c3_chart_fn.turn = function(options){
var $$ = this.internal; var $$ = this.internal;
var turnAngle; var turnAngle;
...@@ -8401,6 +8409,8 @@ ...@@ -8401,6 +8409,8 @@
tspan.text(function (d) { tspan.text(function (d) {
if (d.splitted.length) { if (d.splitted.length) {
// FIXME this should know when
// ticks are rotated
$$.config.maxTickTextWidth = Math.max( $$.config.maxTickTextWidth = Math.max(
$$.config.maxTickTextWidth || 0, $$.config.maxTickTextWidth || 0,
d.splitted.length * fontSize / $$.config.text_h_to_w d.splitted.length * fontSize / $$.config.text_h_to_w
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -99,3 +99,11 @@ c3_chart_fn.axisY = function (value){ ...@@ -99,3 +99,11 @@ c3_chart_fn.axisY = function (value){
$$.redraw(); $$.redraw();
}; };
c3_chart_fn.axisY2 = function(value){
var $$ = this.internal;
$$.config.axis_y2_show = !!value;
$$.axes.y2.style("visibility", $$.config.axis_y2_show ? 'visible' : 'hidden');
$$.redraw();
};
...@@ -61,7 +61,7 @@ c3_chart_fn.bgcolor = function(value) { ...@@ -61,7 +61,7 @@ c3_chart_fn.bgcolor = function(value) {
} }
}; };
c3.chart.fn.turn = function(options){ c3_chart_fn.turn = function(options){
var $$ = this.internal; var $$ = this.internal;
var turnAngle; var turnAngle;
......
...@@ -271,6 +271,8 @@ function c3_axis(d3, params, $$) { ...@@ -271,6 +271,8 @@ function c3_axis(d3, params, $$) {
tspan.text(function (d) { tspan.text(function (d) {
if (d.splitted.length) { if (d.splitted.length) {
// FIXME this should know when
// ticks are rotated
$$.config.maxTickTextWidth = Math.max( $$.config.maxTickTextWidth = Math.max(
$$.config.maxTickTextWidth || 0, $$.config.maxTickTextWidth || 0,
d.splitted.length * fontSize / $$.config.text_h_to_w d.splitted.length * fontSize / $$.config.text_h_to_w
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment