Highcharts: How to Place Y-axis title next to first marker?

Manoj Rejinthala

I am developing application using angular and very new to this high charts. I have requirement where we should place the title next to first marker of bar chart and values are dynamic . here is the existing code https://jsfiddle.net/manoj_rejinthala1510/698mhz2k/3/ .

Highcharts.chart('container', {
    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
       },
      yAxis: {
        
        title: {                    
            text: '<b>Target</b>',
            rotation: 0           
        }
    },
    

    legend: {
        enabled: false
    },

    credits: {
        enabled: false
    },

    series: [{
    type: 'area',
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
    },
    {
    type: 'line',
        data: [50,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,]
    }]
});
<script src="https://code.highcharts.com/highcharts.js"></script>

<div id="container" style="height: 400px"></div>

I want to achieve like i mention in attachment. enter image description here .

Could any one help me to achieve this. Thanks in advance.

ppotaczek

You can place the title dynamically in the render event, for example:

    chart: {
        events: {
            load: function() {
                var yAxis = this.yAxis[0],
                    title = yAxis.axisTitle,
                    firstTick = yAxis.ticks[yAxis.tickPositions[1]];

                title.attr({
                    y: firstTick.label.xy.y
                });

            }
        }
    }

Live demo: https://jsfiddle.net/BlackLabel/30c26hgx/

API Reference: https://api.highcharts.com/highcharts/chart.events.render

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

how to a place different google map marker on the first location

分類Dev

Annotate plot with text left to y axis title

分類Dev

How can I limit the length of a HighCharts PlotLine on the Y-Axis for a BoxPlot?

分類Dev

How to show all marker title in googlemap in android

分類Dev

how to place two div's next to each other, when first div is in two lines?

分類Dev

How to change highcharts graph axis colors on export?

分類Dev

R how to place text on ggplot relative to axis

分類Dev

Make Highcharts pick a smart y-axis min

分類Dev

Highcharts start reversed y-axis at 1 for ranking graph

分類Dev

Highcharts y-axis plotlines label hides the tooltip

分類Dev

How to Display marker title for a few seconds after its creation and then remove it?

分類Dev

Two datasets on a log scale y-axis and another on secondary axis with title

分類Dev

Highcharts yAxis title click

分類Dev

User Editable Title in Highcharts

分類Dev

JFreeChart: how to scale Y-axis when time axis is reduced?

分類Dev

Google map marker title duplicate

分類Dev

How do I place two JSX elements next to each other?

分類Dev

How to place two plots next to each other in Julia?

分類Dev

How to place help icon right next to text box form in Bootstrap?

分類Dev

Highcharts, How to prevent point's marker changes its color on mouse hover?

分類Dev

How does printf round halves to the first decimal place?

分類Dev

How to get an unsaved file in VS Code to use the first line as the title?

分類Dev

Android setOnMarkerClickListener set title for each marker

分類Dev

OpenCV Marker Z axis incorrect transform

分類Dev

タイトルとy_axis.titleのopenpyxlchageフォントサイズ

分類Dev

How to plot (almost) the same function at both sides of the "y" axis in R?

分類Dev

How do you limit the y-axis height in matplotlib?

分類Dev

How to Transpose Column B to y-axis columns in DataFrame

分類Dev

How to change the order of categorical values on y axis of a plot

Related 関連記事

  1. 1

    how to a place different google map marker on the first location

  2. 2

    Annotate plot with text left to y axis title

  3. 3

    How can I limit the length of a HighCharts PlotLine on the Y-Axis for a BoxPlot?

  4. 4

    How to show all marker title in googlemap in android

  5. 5

    how to place two div's next to each other, when first div is in two lines?

  6. 6

    How to change highcharts graph axis colors on export?

  7. 7

    R how to place text on ggplot relative to axis

  8. 8

    Make Highcharts pick a smart y-axis min

  9. 9

    Highcharts start reversed y-axis at 1 for ranking graph

  10. 10

    Highcharts y-axis plotlines label hides the tooltip

  11. 11

    How to Display marker title for a few seconds after its creation and then remove it?

  12. 12

    Two datasets on a log scale y-axis and another on secondary axis with title

  13. 13

    Highcharts yAxis title click

  14. 14

    User Editable Title in Highcharts

  15. 15

    JFreeChart: how to scale Y-axis when time axis is reduced?

  16. 16

    Google map marker title duplicate

  17. 17

    How do I place two JSX elements next to each other?

  18. 18

    How to place two plots next to each other in Julia?

  19. 19

    How to place help icon right next to text box form in Bootstrap?

  20. 20

    Highcharts, How to prevent point's marker changes its color on mouse hover?

  21. 21

    How does printf round halves to the first decimal place?

  22. 22

    How to get an unsaved file in VS Code to use the first line as the title?

  23. 23

    Android setOnMarkerClickListener set title for each marker

  24. 24

    OpenCV Marker Z axis incorrect transform

  25. 25

    タイトルとy_axis.titleのopenpyxlchageフォントサイズ

  26. 26

    How to plot (almost) the same function at both sides of the "y" axis in R?

  27. 27

    How do you limit the y-axis height in matplotlib?

  28. 28

    How to Transpose Column B to y-axis columns in DataFrame

  29. 29

    How to change the order of categorical values on y axis of a plot

ホットタグ

アーカイブ