You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is no way to define the alignment for the xAxis / yAxis title.
For example if I want the xAxis title on the left, I have to position the title with offsets: options: { xAxis: { title: { text: 'Jahre', offsetX: -840, offsetY: -15 }}. This works fine if the chart has a fixed size, but breaks if the chart is responsive.
Example:
constel=document.getElementById('chart-area');constdata={categories: [1,2,3,4,5,6,7,8,9,10],series: [{name: 'Aktien',data: [5000,6000,6200,7000,8000,8900,10000,11000,12000,14000,15000],},{name: 'Wachstum',data: [5030,6050,6260,7070,8030,8920,10500,11060,12700,14800,15300],},{name: 'Asugewogen',data: [5100,6300,6400,7300,8020,8900,15000,11200,12500,14600,15500],},],};constoptions={chart: {width: 'auto',height: 400,},legend: {visible: false},theme: {series: {barWidth: 40,colors: ['red','blue','yellow',]},xAxis: {color: 'transparent'},yAxis: {color: 'transparent'},plot: {vertical: {lineColor: 'transparent',lineWidth: 0,},},},yAxis: {label: {formatter: (value,infos)=>{returnvalue==='0'? '': parseInt(value)}},},xAxis: {title:{text: 'Jahre',offsetX: -840,offsetY: -15},pointOnColumn: true},series: {stack: {type: 'normal'}},responsive: {animation: {duration: 300},rules: [{condition: ({width: w})=>{returnw<=800;},options: {xAxis: {tick: {interval: 2},label: {interval: 2}},}},],},};constchart=toastui.Chart.areaChart({ el, data, options });// "Jahre" is at the wrong position if el is not 900px wide.```
Well,onecoulddefineresponsiveconditionsforeverywidthandsetthecorrectoffsetforeachofit,butthenicerAPIwouldcertainlybeifthetitlebecomesanalignmentoption.
The text was updated successfully, but these errors were encountered:
romanimm
changed the title
Axis 'title' positioning alignment
Axis 'title' position alignment
Aug 3, 2023
Currently there is no way to define the alignment for the xAxis / yAxis title.
For example if I want the xAxis title on the left, I have to position the title with offsets:
options: { xAxis: { title: { text: 'Jahre', offsetX: -840, offsetY: -15 }}
. This works fine if the chart has a fixed size, but breaks if the chart is responsive.Example:
The text was updated successfully, but these errors were encountered: