score:0
i have used css toggle to achieve show more/less. here i used div and p tags, but for best result you have to use ul li
(list tags). also there has to be unique id which you can take from, point attr of highcharts
<input type="checkbox" class="read-more-state" id="post-2" />
<label for="post-2" class="read-more-trigger"></label>
here tooltip does not expands but scrollbar appears
fiddle demo
var chart = new highcharts.chart({
chart: {
renderto: 'container',
},
tooltip: {
backgroundcolor: "rgba(255,255,255,0)",
borderwidth: 0,
shadow: false,
usehtml: true,
formatter: function() {
full_lengthst = `lorem ipsum is simply dummy text of the printing and typesetting industry. lorem ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. it has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. it was popularised in the 1960s with the release of letraset sheets containing lorem ipsum passages, and more recently with desktop publishing software like aldus pagemaker including versions of lorem ipsum.`
string = "";
if (full_lengthst.length > 100) {
string += '<div class="read-more-wrap"><p>' + full_lengthst.substr(0, 100) + '</p>';
string += '<p class="read-more-target">' + full_lengthst.substr(100, full_lengthst.length - 1) + '</p></div> <label for="post-2" class="read-more-trigger"></label>'
} else {
string += '<div class="read-more-wrap"><p>' + full_lengthst + '</p></div>'
}
return `<div class="mycharttooltip">
<input type="checkbox" class="read-more-state" id="post-2" />
` + string + `</div>`;
}
},
series: [{
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]
}]
});
.highcharts-container {
overflow: visible !important;
}
.read-more-state {
display: none;
}
.read-more-target {
opacity: 0;
max-height: 0;
font-size: 0;
transition: .25s ease;
}
.read-more-state:checked~.read-more-wrap .read-more-target {
opacity: 1;
font-size: inherit;
max-height: 999em;
}
.read-more-state~.read-more-trigger:before {
content: 'show more';
}
.read-more-state:checked~.read-more-trigger:before {
content: 'show less';
}
.read-more-trigger {
cursor: pointer;
display: inline-block;
padding: 0 .5em;
color: #666;
font-size: .9em;
line-height: 2;
border: 1px solid #ddd;
border-radius: .25em;
}
.mycharttooltip {
position: relative;
z-index: 50;
border: 2px solid rgb(0, 108, 169);
border-radius: 5px;
background-color: #ffffff;
padding: 5px;
font-size: 9pt;
overflow: auto;
height: 50px;
width: 100px
}
.highcharts-tooltip {
pointer-events: all !important;
}
<script type="text/javascript" src="https://code.highcharts.com/highcharts.src.js">
</script>
<div id="container" style="height: 300px"></div>
Source: stackoverflow.com
Related Query
- How to do In highchart tooltip display the first 100 characters and then say "See more .."?
- How to use the tooltip formatter and still display chart color (like it does by default)?
- How to add a vertical plot line in multiple line series and show the tooltip on Plot line in highchart
- How to set the position of the first and last child of the tooltip
- How to display highchart series line marker symbol from tooltip formatter?
- Highcharts - How to display legend symbol inside the tooltip
- How can I do in Highchart to have 1px space between the columns and the y Axis?
- How to start and end a dynamically generetad datetime highchart's xAxis on the first and last tick
- How to set series-label to false by default and change the color of series label text in highchart
- how to display 2 same highcharts without duplicate the code
- Why does this Highcharts graph only show tooltip for the first and last nodes?
- How to show open, close, high and low in tooltip when the chart type is 'line' in highstocks?
- How to set the highchart and the table horizontally?
- How do I calculate the total Data values for both and display in Legend
- Highstock - How can i display the open, high, low, close in the line or area charts tooltip
- How to use axios to fetch data from servlet and then crossfilter it and display via highcharts
- Display tooltip on mouseover in the Highchart Stack Column Total
- how to customize the tooltip in solid gauge in highchart
- How to remove default Hover text and display the custom text title on hover Donut chart Highcharts
- How to show only the last 100 candlesticks or hide the first 50 candlesticks in Highcharts Stock Chart?
- How to remove the label of scale label and tooltip on speedometer?
- How to make the full million value show up on y-axis and tooltip (Highcharts)
- How to display maximum and minimum value on the basis of date selected in High Charts?
- How to adjust the height and width of background color in Highchart
- Setting the length of the X-Axis of a Highchart to be 24 hours from time of first data point with less than 24 hours of data to display
- How to display multiple values of the same attribute when hovering on tooltip with highcharts/highmaps
- Display tooltip on hovering over the legend using Highcharts and jQuery-ui tooltip plugin
- Highcharts: how to group data points and display the total accordingly?
- How to differentiate the xAxis and yAxis plotbands in Highchart
- How to highlight and show tooltip for correct (left / right) step point instead of the closest point
More Query from same tag
- How to display a clickable pie chart in the cell of a html table?
- Why isn't my highcharts chart getting reset/destroyed properly?
- highcharts x axis date variable range
- Dynamically create highcharts with bootstrap carousel
- How can I reset the styles given to series in Highcharts?
- Highcharts menus bottom into right side of the graph
- Highcharts legend js error
- Highcharts with object array
- Fixed plot height in scatter chart
- Highcharts Graph displays correctly ONLY on Window Resize
- Keep selection in highcharts even on page refresh
- Issue on Setting Up Highchats.js Index of Chart
- High Charts stack column from json object
- How i can get the 2 decimal places?
- How to parse and create JSON tuples with php
- Highstock, border around yAxis or different background colors for each yAxis?
- Hidden Highcharts not sizing correctly until window resize
- Pushing data into Highcharts Series in SAPUI5
- Highcharts Heatmap Set Column Width
- Attach object to Highcharts click event
- express json object in highcharts
- Highcharts - My nice thin cross hair changes to a thick green cross hair when adding categories
- Background color to highcharts
- Data security highcharts
- Last label on xaxis disappears when resize
- Like to show all the labels of x axis in highchart
- Highcharts are squished in html tabs
- Need to apply background color to each legend text highchart
- Rendering a table with Chart.renderer.text
- HighCharts chart asp.net mvc rendering