Skip to content

Commit

Permalink
fix(gv-chart-line): use more column in tooltip to avoid length issue …
Browse files Browse the repository at this point in the history
  • Loading branch information
gaetanmaisse committed Mar 7, 2023
1 parent 6663b4c commit c6a57f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/charts/gv-chart-line/gv-chart-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ export class GvChartLine extends ChartElement(LitElement) {
},
tooltip: {
formatter: function () {
const nbCol = Math.trunc(this.points.filter((p) => p.y).length / 10);
const maxNumberOfElementPerColumn = 6;
const nbCol = Math.trunc(this.points.filter((p) => p.y).length / maxNumberOfElementPerColumn);
let s = '<div><b>' + new Date(this.x).toLocaleString(getLanguage()) + '</b></div>';
s += '<div class="' + (nbCol >= 2 ? 'tooltip tooltip-' + (nbCol > 5 ? 5 : nbCol) : '') + '">';
if (
Expand Down

0 comments on commit c6a57f9

Please sign in to comment.