Comments (18)
annotations not working !
please help me :(
from highcharts-react.
Hi rohankk2,
There should be no problems with the combination of annotations and react wrapper. Did you include annotations module?
require("highcharts/modules/annotations")(Highcharts);
Live demo: https://codesandbox.io/s/9jxnk5zv2w
from highcharts-react.
import * as Highcharts from 'highcharts';
import * as AnnotationsModule from 'highcharts/modules/annotations';
AnnotationsModule(Highcharts);
from highcharts-react.
This worked for me:
import HighchartsReact from "highcharts-react-official"
import Highcharts from "highcharts/highstock"
import HighchartsExporting from "highcharts/modules/exporting"
import AnnotationsModule from "highcharts/modules/annotations"
AnnotationsModule(Highcharts)
from highcharts-react.
import React,{Component} from "react";
import Highcharts from 'highcharts';
import HighchartsReact from "highcharts-react-official";
import Table1 from './table.js';
require("highcharts/modules/annotations")(Highcharts);
I added the same imports as above. I am still not seeing the annotations. I can pretty much enable most of the other features of highcharts except annotations.
this is how i am calling the required element in render :
<HighchartsReact highcharts={Highcharts} constructorType={'chart'} options={this.state.options} />
var options = {
title: {
text: 'DATA',
allowDragX: true,
},
legend: {
enabled: true
},
chart: {
type: 'column'
},
xAxis: {
title: {text: 'Point'},
categories: body2
},
yAxis:
{
title: {
text: 'Tp',
},
},
annotations: [{
labels: [{
point: 'max',
text: 'Max'
}, {
point: 'min',
text: 'Min',
backgroundColor: 'black'
}]
}],
series:
{
name:'Tp',
data: r ,
},
credits:{
enabled:false
},
};
The above is my highcharts code.
from highcharts-react.
I tried your exact example. It showed the graph but no annotation loaded!
from highcharts-react.
Hi rohankk2,
As you can see in my example annotations works, so probably there is a problem in your project. Without reproducing this issue I will not be able to help you, so please prepare some live example in codesandbox.
Best regards!
from highcharts-react.
I also had problems using annotations, so I opted flags instead. Never got those annotations to show
from highcharts-react.
@justduy, Could you reproduce your problem with annotations?
from highcharts-react.
@ppotaczek I would recommend try loading annotations with data loaded from a server rather than using hardcoded fields. Moreover, I was able to repro the problem only when i had highchartsReact declared inside a component called charts and then called that component charts in the main index.js file. So if you try the above two things, you should see the problem
from highcharts-react.
@rohankk2, I reproduced the situation you describe and the annotations still work. Perhaps, you use require("highcharts/modules/annotations")(Highcharts)
in wrong place. Could you adapt the example below so that we can show the problem?
Live example with dynamic data and separate component: https://codesandbox.io/s/lpq487joyz
from highcharts-react.
Closing due to inactivity.
from highcharts-react.
annotations not working in react js i am using typescript. installed highchart-annotations still not showing annotations
from highcharts-react.
Hello @ashwiniIot, Please reproduce the problem in codesandbox.
from highcharts-react.
I recreated this here:
https://codesandbox.io/s/highcharts-react-demo-forked-q6ex2?file=/demo.tsx
In my case I can't get any line annotations to show up as shown above.
from highcharts-react.
Hi @JonathanGVC,
The problem is not related with highcharts-react, your annotation options are incorrect. Please check the example below.
Live demo: https://codesandbox.io/s/highcharts-react-demo-5uygw?file=/demo.tsx
API Reference: https://api.highcharts.com/highcharts/annotations
from highcharts-react.
@ppotaczek Can you change the example to generate an infinite line, it's the annotation I specifically need and can't get to work. The example can't be expanded to show that type.
from highcharts-react.
It seems that a better choice for you is to use plot lines.
Example: https://codesandbox.io/s/highcharts-react-demo-fork-fpp86?file=/demo.tsx
from highcharts-react.
Related Issues (20)
- Rendering simple chart with React Testing Library fails (computes NaN values) HOT 2
- Runtime error when chart tries to update while hovering over a series HOT 4
- Usage in React, Grid lines not visible HOT 2
- Tooltip is going under axis-component HOT 8
- Chart values and options doesn't trigger re-render HOT 2
- Zones rendering issue after updating to [email protected] HOT 5
- Issue whille integrating packedbubble in react-highcharts HOT 15
- TypeError: Cannot read properties of undefined (reading 'length') HOT 1
- Plotbands added via API are not added to plotOptions HOT 2
- Next.js 14.1.0 Cannot read properties of undefined (reading 'document') HOT 2
- Add a react ref to each point HOT 4
- chart.update() refression with yAxis behavior HOT 23
- Unexpected series order when adding linkedTo series HOT 2
- Cannot read properties of undefined (reading 'forEach') HOT 3
- Server side rendering of React components HOT 1
- Issue with borderRadius object HOT 1
- i am unable to draw a Polar (Radar) chart HOT 2
- Is this the correct way to use the Boost module to improve performance? HOT 3
- Updating a column chart's series data with dataSorting: enabled causes a crash HOT 2
- Bar Chart Rendering is different if I use boost HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from highcharts-react.