@@ -92,7 +92,7 @@ For the above markup to function properly it is necessary to
9292implement ` line-chart.js ` :
9393
9494<Source code = { `
95- import { LineChart, formatWithDecimalZero, select, format, timeFormat, timeYear } from 'respvis';
95+ import { LineChart, formatWithDecimalZero, select, format, timeFormat, timeYear } from './package/ respvis.js ';
9696
9797// Data Source: Studierendenstatistik
9898// https://online.tugraz.at/tug_online/studierendenstatistik.html
@@ -101,30 +101,30 @@ import { LineChart, formatWithDecimalZero, select, format, timeFormat, timeYear
101101// ordentlich gemeldet, ohne Mitbeleger, jeweils im WS
102102
103103const students = [
104- 8291, 8785, 9203, 9766, 10245, 11211, 11681, 12105, 12323,
105- 12565, 12764, 13167, 13454, 13737, 13373, 13566, 13673, 13712
104+ 8291, 8785, 9203, 9766, 10245, 11211, 11681, 12105, 12323,
105+ 12565, 12764, 13167, 13454, 13737, 13373, 13566, 13673, 13712
106106]
107107
108108const years = [
109- "2004", "2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012",
110- "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021"
109+ "2004", "2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012",
110+ "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021"
111111]
112112
113113export function createLineChart(selector) {
114- const args = {
115- series: {
116- x: {
117- values: years
118- },
119- y: {
120- values: students
121- }
114+ const args = {
115+ series: {
116+ x: {
117+ values: years
118+ },
119+ y: {
120+ values: students
121+ }
122+ }
122123 }
123- }
124124
125- const chartWindow = select(selector).append('div')
126- const chart = new LineChart(chartWindow, args)
127- chart.buildChart()
125+ const chartWindow = select(selector).append('div')
126+ const chart = new LineChart(chartWindow, args)
127+ chart.buildChart()
128128}
129129` } language = { " typescript" } />
130130
@@ -304,7 +304,7 @@ In addition, one can decide to move information from the title to the smaller su
304304...
305305const args = {
306306 ...
307- breakPoints : {
307+ breakpoints : {
308308 width: {
309309 values: [20, 30, 50],
310310 unit: 'rem'
@@ -339,7 +339,7 @@ const args = {
339339 ...
340340 x: {
341341 // Breakpoints can also be added to axes
342- breakPoints : {
342+ breakpoints : {
343343 width: {
344344 values: [10, 30, 50],
345345 unit: 'rem'
@@ -367,14 +367,14 @@ const args = {
367367 },
368368 // By using breakpoints and tickOrientation one
369369 // can adjust the orientation depending on the
370- // current layout width. The current mapping
370+ // current layout width. The current breakpointValues
371371 // can be read as: Ticks have 90° orientation
372- // in layout width 0 , 0° orientation in layout
373- // width 3 and in between these widths the
374- // tick orientation is interpolated.
372+ // if breakpoint 0 is undercut , 0° orientation if
373+ // breakpoint 2 is exceeded and in between these breakpoints
374+ // the tick orientation is interpolated.
375375 tickOrientation: {
376376 dependentOn: 'width',
377- mapping : { 0: 90, 3 : 0}
377+ breakpointValues : { 0: 90, 2 : 0}
378378 }
379379 },
380380 y: {
@@ -415,10 +415,8 @@ const args = {
415415 ...
416416 series: {
417417 ...
418- markerTooltips: {
419- tooltips: function (_, {xValue, yValue}) {
420- return \` Year: \$ {xValue}<br/>Students: \$ {format('.2f')(yValue)}\`
421- },
418+ markerTooltipGenerator: function (_, {xValue, yValue}) {
419+ return \` Year: \$ {xValue}<br/>Students: \$ {format('.2f')(yValue)}\`
422420 },
423421 labels: {
424422 values: students.map(student => student.toString()),
0 commit comments