-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
highcharts/exercise4 #3
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, the exercise is done almost correctly.
Please take a look at the below comments.
nonData = [32, 43, 55, 78, 12] | ||
max = 100, | ||
maxColor = '#FF0000', | ||
seriesColor = '#A1B5C9' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you swap the colors by mistake. In the image the actual series is red and the 'fake' one is gray. So lines 5 and six should look like this:
maxColor = '#A1B5C9',
seriesColor = '#FF0000';
@@ -0,0 +1,89 @@ | |||
const categories = ['Dep1','Dep2', 'Dep3', 'Dep4', 'Dep5']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the semicolon and add a comma here 😄
@@ -0,0 +1,89 @@ | |||
const categories = ['Dep1','Dep2', 'Dep3', 'Dep4', 'Dep5']; | |||
data = [50, 36, 50, 40, 14], | |||
nonData = [32, 43, 55, 78, 12] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing comma
nonData = [32, 43, 55, 78, 12] | ||
max = 100, | ||
maxColor = '#FF0000', | ||
seriesColor = '#A1B5C9' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
semicolon at the end of the line
data = [50, 36, 50, 40, 14], | ||
nonData = [32, 43, 55, 78, 12] | ||
max = 100, | ||
maxColor = '#FF0000', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maxColor name might be confusing, I would change this variable name to something like fakeSeriesColor 😄
@@ -0,0 +1,89 @@ | |||
const categories = ['Dep1','Dep2', 'Dep3', 'Dep4', 'Dep5']; | |||
data = [50, 36, 50, 40, 14], | |||
nonData = [32, 43, 55, 78, 12] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nonData name might be confusing, I would change this variable name to something like fakeSeriesData
type: 'bar', | ||
marginTop: 50, | ||
events: { | ||
// Probably need to do something here with the labels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good guess! By modyfing yAxis.title.y property you could change the position of the yAxis title. You can do it in the load event using the update method on the yAxis. Remember to not hardcoding the value but calculate it using such values as chart.plotTop or chart.chartHeight.
Useful links:
https://api.highcharts.com/highcharts/yAxis.title.y
https://api.highcharts.com/class-reference/Highcharts.Axis#update
If you need any help with that feel free to contact me here or on Slack. 😄
Added solution for Highcharts Exercise 4. I can not manage to get the labels on the YAxis to appear on the top instead of the bottom.