$(function() { var all_chart_options = { "chart": { "renderTo": "chart2", "margin": [100, 40, 80, 80], "borderWidth": 0, "plotBorderColor": "#000", "plotBorderWidth": 0, "type": "line", "events": { "redraw": function redraw() { if (chart) { $.each(chart.series, function(i, serie) { $.each(serie.data, function(j, point) { if (point.options.cursor === "pointer") { point.graphic.attr({ cursor: 'pointer' }); } }); }); } } }, "zoomType": null, "alignTicks": false, "ignoreHiddenSeries": true, "inverted": false }, "colors": ["#7cb5ec", "#434348", "#90ed7d", "#f7a35c", "#8085e9", "#f15c80", "#e4d354", "#2b908f", "#f45b5b", "#91e8e1", "#2f7ed8", "#0d233a", "#8bbc21", "#910000", "#1aadce", "#492970", "#f28f43", "#77a1e5", "#c42525", "#a6c96a"], "legend": { "align": "left", "alignColumns": false, "backgroundColor": "none", "borderColor": "none", "borderWidth": 0, "enabled": true, "floating": true, "itemDistance": 30, "layout": "horizontal", "reversed": false, "shadow": false, "symbolRadius": 0, "title": {}, "useHTML": false, "verticalAlign": "top", "width": 540, "x": 150, "y": 40, "itemStyle": { "fontFamily": "Calibri, Arial, Helvetica, sans-serif", "color": "#000", "cursor": "pointer", "textOverflow": "wrap" }, "itemHiddenStyle": { "color": "gray" }, "itemHoverStyle": { "cursor": "pointer" } }, "plotOptions": { "series": { "events": { "legendItemClick": function legendItemClick(event) {} }, "dataLabels": { "enabled": false, "allowOverlap": false, "padding": 0, "verticalAlign": "bottom", "style": { "textShadow": "none", "color": "#000" } }, "pointPlacement": null, "stacking": null, "pointPadding": 0.1, "groupPadding": 0.2, "minPointLength": 2, "minSize": 4, "sizeBy": "width", "lineWidth": 1.5, "states": { "hover": { "lineWidth": 4 } }, "marker": { "enabled": false, "states": { "hover": { "enabled": true, "radius": 5 } } } }, "bubble": { "tooltip": { "followPointer": true } }, "line": {}, "boxplot": { "fillColor": "#F0F0E0" }, "pie": { "showInLegend": true, "size": "130%" } }, "series": [{ "name": "PPI for unleaded regular gasoline", "data": [127.6, 133.5, 130.3, 147.6, 171.5, 204, 185, 206.3, 194.4, 191.8, 205.5, 201.1, 220.2, 201.6, 222.9, 230, 227.4, 217.6, 218.9, 221.1, 215.5, 227.6, 230.4, 237.7, 250.2, 257.2, 293.9, 319.7, 343.3, 311.9, 310.7, 295.9, 303.2, 287.7, 278.5, 270.8, 279.2, 294.3, 315, 324.7, 308.4, 294.4, 286.4, 309.4, 328.4, 314.4, 277.3, 267.9, 270.3, 297.5, 297.8, 292.6, 299.7, 296.7, 295, 300.5, 294.9, 281.7, 267.3, 265.5, 267.4, 274.2, 286.8, 302.4, 299.7, 303, 296.8, 294, 282.1, 252.8, 227.7, 190.6, {y:145.4, marker: {enabled:true}, dataLabels:{enabled: true, x: -70, y: 5, formatter: function(){ return "Level shift: Jan 2015";}}}, 154.5, 173.9, 173.8, 205.4, 208.7, 207.3, 192.8, {y:161.6, marker: {enabled:true}, dataLabels:{enabled: true, x: 50, y: -15, formatter: function(){ return "Level shift: Sept 2015";}}}, 152.7, 147.5, 131.5, 120.3, 107.1, 117.1, 134.4, 145.9, 159, 151.9, 144.6, 146.3, 155.9, 142, 150.6, 161.4, 161.9, 160, 171.7, 158.5, 157.2, 155.1, 164.4, 183.6, 170.3, 181.6, 177.2], "type": "line", "color": "#7cb5ec", "_symbolIndex": 0, "stacking": null, "visible": true, "decimals": "1" }], "subtitle": { "text": "", "align": "left", "style": { "color": "#000000", "fontFamily": "arial", "fontWeight": "normal", "fontSize": "12px" } }, "title": { "text": " Figure 2. Producer Price Index for unleaded regular gasoline, 2009-2017 ", "align": "left", "style": { "color": "#000000", "fontFamily": "arial", "fontWeight": "bold", "fontSize": "14px" } }, "tooltip": { "backgroundColor": "#FEFFEF", "crosshairs": [false, false], "formatter": function() { var options = this.series.chart.tooltip.options; var dollar = this.series.options.dollar || options.y_signs_arr[0]; var percent = this.series.options.percent || options.y_signs_arr[1]; var decimals = this.series.options.decimals || options.y_decimals; var multiple = options.multiplier; if (all_chart_options.series[this.series.index].yAxis == 1) { dollar = options.y_signs_arr_2[0]; percent = options.y_signs_arr_2[1]; decimals = options.y_decimals_2; multiple = options.multiplier_2; } var y_val = this.point.high ? "High: " + dollar + $(this.point.high * multiple).addCommas(decimals) + percent + " | Low: " + dollar + $(this.point.low * multiple).addCommas(decimals) + percent : dollar + $(this.y * multiple).addCommas(decimals) + percent; var s = "" + this.series.name + "
" + this.x + ": " + y_val; all_chart_options.series[this.series.index] ? s = all_chart_options.tooltip.addExtraData(all_chart_options.series[this.series.index].extra_data, this.point, s) : s = s; return s.replace(/\$-/g, "-$"); }, "style": { "color": "#000000", "fontFamily": "Calibri, Arial, Helvetica, sans-serif" }, "useHTML": false, "shared": false, "addExtraData": function(extra_data, point, s) { if (extra_data && extra_data[0].name) { $.each(extra_data, function(i) { if (extra_data[i].values[point.index]) { s = s + "
" + extra_data[i].name + ": " + extra_data[i].values[point.index]; } }); } return s; }, "x_signs_arr": ["", ""], "z_signs_arr": ["", ""], "y_decimals": 0, "y_decimals_2": 0, "x_decimals": 0, "z_decimals": 0, "z_title": "Z", "multiplier": 1, "multiplier_2": 1, "y_signs_arr": ["", ""], "y_signs_arr_2": ["", ""] }, "xAxis": { "categories": ["Jan-09", "Feb-09", "Mar-09", "Apr-09", "May-09", "Jun-09", "Jul-09", "Aug-09", "Sep-09", "Oct-09", "Nov-09", "Dec-09", "Jan-10", "Feb-10", "Mar-10", "Apr-10", "May-10", "Jun-10", "Jul-10", "Aug-10", "Sep-10", "Oct-10", "Nov-10", "Dec-10", "Jan-11", "Feb-11", "Mar-11", "Apr-11", "May-11", "Jun-11", "Jul-11", "Aug-11", "Sep-11", "Oct-11", "Nov-11", "Dec-11", "Jan-12", "Feb-12", "Mar-12", "Apr-12", "May-12", "Jun-12", "Jul-12", "Aug-12", "Sep-12", "Oct-12", "Nov-12", "Dec-12", "Jan-13", "Feb-13", "Mar-13", "Apr-13", "May-13", "Jun-13", "Jul-13", "Aug-13", "Sep-13", "Oct-13", "Nov-13", "Dec-13", "Jan-14", "Feb-14", "Mar-14", "Apr-14", "May-14", "Jun-14", "Jul-14", "Aug-14", "Sep-14", "Oct-14", "Nov-14", "Dec-14", "Jan-15", "Feb-15", "Mar-15", "Apr-15", "May-15", "Jun-15", "Jul-15", "Aug-15", "Sep-15", "Oct-15", "Nov-15", "Dec-15", "Jan-16", "Feb-16", "Mar-16", "Apr-16", "May-16", "Jun-16", "Jul-16", "Aug-16", "Sep-16", "Oct-16", "Nov-16", "Dec-16", "Jan-17", "Feb-17", "Mar-17", "Apr-17", "May-17", "Jun-17", "Jul-17", "Aug-17", "Sep-17", "Oct-17", "Nov-17", "Dec-17"], "gridLineColor": "#c0c0c0", "gridLineWidth": 0, "gridLineDashStyle": "Dot", "labels": { "rotation": 0, "useHTML": false, "style": { "color": "#000000", "fontFamily": "Calibri, Arial, Helvetica, sans-serif", "fontWeight": "normal", "backgroundColor": "#fff", "fontSize": "12px", "textOverflow": "wrap" } }, "lineWidth": 1.2, "lineColor": "gray", "max": null, "min": null, "plotBands": [], "plotLines": [{ "value": 0, "color": "#c0c0c0", "dashStyle": "solid", "width": 0 }], "startOnTick": false, "tickInterval": 9, "tickmarkPlacement": "on", "tickPosition": "outside", "tickColor": "#C0D0E0", "title": { "align": "middle", "useHTML": true, "text": "", "margin": 6, "rotation": 0, "style": { "color": "#000000", "fontFamily": "Calibri, Arial, Helvetica, sans-serif", "fontWeight": "normal", "backgroundColor": "#fff", "fontSize": "13px" }, "x": 0 }, "type": "linear" }, "yAxis": { "gridLineColor": "#c0c0c0", "gridLineWidth": 1, "gridLineDashStyle": "Dot", "labels": { "formatter": function yAxisFormat() { var decimals = this.axis.options.labels.decimals; var signs_arr = this.axis.options.labels.signs_arr; var dividend = this.axis.options.labels.dividend; var s = Highcharts.numberFormat(this.value / dividend, decimals, ".", ","); s = signs_arr[0] + s + signs_arr[1]; return s.replace(/\$-/g, "-$"); }, "rotation": 0, "style": { "color": "#000000", "fontFamily": "Calibri, Arial, Helvetica, sans-serif", "fontWeight": "normal", "backgroundColor": "#fff", "fontSize": "12px" }, "signs_arr": ["", ""], "decimals": "1", "dividend": 1 }, "lineColor": "gray", "lineWidth": 1, "max": 350, "min": 100, "minPadding": 0.6, "opposite": false, "plotBands": [], "plotLines": [{ "value": 0, "color": "#c0c0c0", "dashStyle": "solid", "width": 1 }], "tickInterval": null, "tickmarkPlacement": "on", "tickPosition": "outside", "tickColor": "#C0D0E0", "tickWidth": 1, "title": { "useHTML": false, "text": "Index level", "margin": 6, "align": "high", "offset": 20, "rotation": 0, "x": 20, "y": -20, "style": { "color": "#000000", "fontFamily": "Calibri, Arial, Helvetica, sans-serif", "fontWeight": "normal", "fontSize": "13px" } }, "type": "linear" }, "credits": { "href": "/", "position": { "align": "left", "x": 10, "y": -22 }, "style": { "cursor": "default", "color": "#2C2C2C" }, "target": "_blank", "text": "Click legend items to change data display. Hover over chart to view data.
Source: U.S. Bureau of Labor Statistics.", "useHTML": true }, "exporting": { "sourceWidth": 640, "scale": 1, "buttons": { "contextButton": { "enabled": true, "verticalAlign": "bottom", "x": -10 } } }, "saved_values": [{ "id": "chart_type_icons", "val": "line" }, { "id": "chart_id_textinput", "val": "chart1" }, { "id": "map_type_select", "val": "state" }, { "id": "map_animated_checkbox", "val": false }, { "id": "map_color_by_names_checkbox", "val": false }, { "id": "bubble_animated_checkbox", "val": false }, { "id": "drilldown_type_select", "val": "bar" }, { "id": "chart_width_textinput", "val": "580" }, { "id": "chart_height_textinput", "val": "430" }, { "id": "top_margin_textinput", "val": "100" }, { "id": "right_margin_textinput", "val": "40" }, { "id": "bottom_margin_textinput", "val": "80" }, { "id": "left_margin_textinput", "val": "80" }, { "id": "map_spotlight_size_checkbox", "val": false }, { "id": "map_circle_size_range", "val": "10" }, { "id": "map_circle_size_by_select", "val": "main_values" }, { "id": "table_input_load_series_from_icons", "val": "column_heads" }, { "id": "example_table_select", "val": "scatter_with_unique_point_names" }, { "id": "table_input_textarea", "val": "
Figure 2. Producer Price Index for unleaded regular gasoline, 2009-2017
DatePPI for unleaded regular gasoline

Jan-09

127.6

Feb-09

133.5

Mar-09

130.3

Apr-09

147.6

May-09

171.5

Jun-09

204.0

Jul-09

185.0

Aug-09

206.3

Sep-09

194.4

Oct-09

191.8

Nov-09

205.5

Dec-09

201.1

Jan-10

220.2

Feb-10

201.6

Mar-10

222.9

Apr-10

230.0

May-10

227.4

Jun-10

217.6

Jul-10

218.9

Aug-10

221.1

Sep-10

215.5

Oct-10

227.6

Nov-10

230.4

Dec-10

237.7

Jan-11

250.2

Feb-11

257.2

Mar-11

293.9

Apr-11

319.7

May-11

343.3

Jun-11

311.9

Jul-11

310.7

Aug-11

295.9

Sep-11

303.2

Oct-11

287.7

Nov-11

278.5

Dec-11

270.8

Jan-12

279.2

Feb-12

294.3

Mar-12

315.0

Apr-12

324.7

May-12

308.4

Jun-12

294.4

Jul-12

286.4

Aug-12

309.4

Sep-12

328.4

Oct-12

314.4

Nov-12

277.3

Dec-12

267.9

Jan-13

270.3

Feb-13

297.5

Mar-13

297.8

Apr-13

292.6

May-13

299.7

Jun-13

296.7

Jul-13

295.0

Aug-13

300.5

Sep-13

294.9

Oct-13

281.7

Nov-13

267.3

Dec-13

265.5

Jan-14

267.4

Feb-14

274.2

Mar-14

286.8

Apr-14

302.4

May-14

299.7

Jun-14

303.0

Jul-14

296.8

Aug-14

294.0

Sep-14

282.1

Oct-14

252.8

Nov-14

227.7

Dec-14

190.6

Jan-15

145.4

Feb-15

154.5

Mar-15

173.9

Apr-15

173.8

May-15

205.4

Jun-15

208.7

Jul-15

207.3

Aug-15

192.8

Sep-15

161.6

Oct-15

152.7

Nov-15

147.5

Dec-15

131.5

Jan-16

120.3

Feb-16

107.1

Mar-16

117.1

Apr-16

134.4

May-16

145.9

Jun-16

159.0

Jul-16

151.9

Aug-16

144.6

Sep-16

146.3

Oct-16

155.9

Nov-16

142.0

Dec-16

150.6

Jan-17

161.4

Feb-17

161.9

Mar-17

160.0

Apr-17

171.7

May-17

158.5

Jun-17

157.2

Jul-17

155.1

Aug-17

164.4

Sep-17

183.6

Oct-17

170.3

Nov-17

181.6

Dec-17

177.2

Source: U.S. Bureau of Labor Statistics, Consumer Expenditure Surveys Public-Use Microdata

" }, { "id": "color_palettes", "val": -1 }, { "id": "use_custom_colors_checkbox", "val": false }, { "id": "custom_colors_textarea", "val": "Aqua green CornflowerBlue #FF1493 #A52A2A #FF7F50 rgb(184,134,11) rgb(139,0,139) rgb(255,215,0)\n " }, { "id": "series_color_0", "val": "7CB5EC" }, { "id": "series_type_div_0", "val": "line" }, { "id": "line_style_select_0", "val": "Solid" }, { "id": "individual_tooltip_signs_select_0", "val": "no_signs" }, { "id": "series_decimals_select_0", "val": null }, { "id": "use_2nd_y_axis_checkbox_0", "val": false }, { "id": "series_visible_checkbox_0", "val": true }, { "id": "series_extra_data_title_textarea_0", "val": "" }, { "id": "series_extra_data_values_textarea_0", "val": "" }, { "id": "legend_layout_select", "val": "horizontal" }, { "id": "map_legend_enabled_checkbox", "val": true }, { "id": "map_legend_decimals_select", "val": null }, { "id": "legend_placement_x", "val": "150" }, { "id": "legend_placement_y", "val": "40" }, { "id": "legend_reverse_layout_checkbox", "val": false }, { "id": "legend_width_input", "val": "" }, { "id": "legend_item_width_input", "val": "" }, { "id": "legend_alphabetical_layout_checkbox", "val": false }, { "id": "legend_make_toggle_checkbox", "val": false }, { "id": "chart_x_axis_title_textarea", "val": "" }, { "id": "chart_x_axis_x_position_input", "val": "40" }, { "id": "chart_x_axis_tickmark_interval_input", "val": "9" }, { "id": "chart_x_axis_min_input", "val": "" }, { "id": "chart_x_axis_max_input", "val": "" }, { "id": "chart_x_axis_show_only_years", "val": false }, { "id": "chart_x_axis_add_commas", "val": false }, { "id": "chart_x_axis_signs_select", "val": "no_signs" }, { "id": "chart_x_axis_decimals_select", "val": null }, { "id": "chart_y_axis_title_textarea", "val": "Index level" }, { "id": "chart_y_axis_x_position_input", "val": "20" }, { "id": "chart_y_axis_tickmark_interval_input", "val": "" }, { "id": "chart_y_axis_min_input", "val": "100" }, { "id": "chart_y_axis_max_input", "val": "350" }, { "id": "chart_y_axis_opposite_checkbox", "val": false }, { "id": "chart_y_axis_log_checkbox", "val": false }, { "id": "chart_y_axis_signs_select", "val": "no_signs" }, { "id": "chart_y_axis_decimals_select", "val": "1" }, { "id": "chart_y_axis_divide_select", "val": "1" }, { "id": "chart_y_axis_2_enabled_checkbox", "val": false }, { "id": "chart_y_axis_title_textarea_2", "val": "" }, { "id": "chart_y_axis_x_position_input_2", "val": "-75" }, { "id": "chart_y_axis_tickmark_interval_input_2", "val": "5" }, { "id": "chart_y_axis_min_input_2", "val": "0" }, { "id": "chart_y_axis_max_input_2", "val": "100" }, { "id": "chart_y_axis_signs_select_2", "val": "no_signs" }, { "id": "chart_y_axis_decimals_select_2", "val": null }, { "id": "chart_tooltip_shared_checkbox", "val": false }, { "id": "chart_tooltip_force_decimals_select", "val": "0" }, { "id": "chart_tooltip_signs_select", "val": "no_signs" }, { "id": "chart_tooltip_force_decimals_x_select", "val": "0" }, { "id": "chart_tooltip_signs_x_select", "val": "no_signs" }, { "id": "chart_tooltip_force_decimals_z_select", "val": "0" }, { "id": "chart_tooltip_signs_z_select", "val": "no_signs" }, { "id": "map_tooltip_main_value_font_size_input", "val": "30" }, { "id": "map_tooltip_na_text_input", "val": "N/A" }, { "id": "map_tooltip_prepend_to_value_text_input", "val": "" }, { "id": "chart_z_title_text_input", "val": "" }, { "id": "chart_tooltip_y_multiple_select", "val": "1" }, { "id": "chart_tooltip_force_decimals_select_2", "val": "0" }, { "id": "chart_tooltip_signs_select_2", "val": "no_signs" }, { "id": "chart_tooltip_y_multiple_select_2", "val": "1" }, { "id": "chart_credits_text_textarea", "val": "Click legend items to change data display. Hover over chart to view data.\nSource: U.S. Bureau of Labor Statistics." }, { "id": "point_padding_input", "val": ".1" }, { "id": "group_padding_input", "val": ".2" }, { "id": "chart_subtitle_textarea", "val": "" }, { "id": "map_animation_speed_range", "val": "500" }, { "id": "map_animated_start_at_last_date_checkbox", "val": false }, { "id": "map_include_puerto_rico_checkbox", "val": false }, { "id": "map_include_virgin_islands_checkbox", "val": false }, { "id": "map_add_ranked_columns_checkbox", "val": false }, { "id": "map_add_state_labels_checkbox", "val": false }, { "id": "chart_zoom_select", "val": "false,false,null" }, { "id": "chart_show_data_labels_checkbox", "val": false }, { "id": "chart_scatter_add_45_line_checkbox", "val": false }, { "id": "chart_scatter_add_regression_line_checkbox", "val": false }, { "id": "chart_scatter_highlight_points_select", "val": "no_highlight" }, { "id": "chart_add_recession_shading_select", "val": "no_recession" }] }; var chartCallback = function chartCallback(all_chart_options) { if (all_chart_options.timeline) { //call animation if applicable all_chart_options.timeline.animation(); } $(".highcharts-legend-item").css("min-height", "0px").css("z-index", 100); //fix so CMS CSS doesn't make legend taller than it should $(".highcharts-tooltip").css("z-index", 200); /** * Highcharts plugin for setting a lower opacity for other series than the one that is hovered * in the legend */ (function(Highcharts) { var each = Highcharts.each; Highcharts.wrap(Highcharts.Legend.prototype, 'renderItem', function(proceed, item) { proceed.call(this, item); var isPoint = !!item.series, collection = isPoint ? item.series.points : this.chart.series, groups = isPoint ? ['graphic'] : ['group', 'markerGroup'], element = (this.options.useHTML ? item.legendItem : item.legendGroup).element; element.onmouseover = function() { each(collection, function(seriesItem) { if (seriesItem !== item) { each(groups, function(group) { seriesItem[group].animate({ opacity: 0.25 }, { duration: 150 }); }); } }); }; element.onmouseout = function() { each(collection, function(seriesItem) { if (seriesItem !== item) { each(groups, function(group) { seriesItem[group].animate({ opacity: 1 }, { duration: 50 }); }); } }); }; }); Highcharts.wrap(Highcharts.Chart.prototype, 'showCredits', function(proceed, credits) { proceed.call(this, credits); if (this.credits && credits.target) { this.credits.on('click', function() { $('').attr({ href: credits.href, target: credits.target })[0].click(); }); } }); })(Highcharts); //end gray other series plugin }; Highcharts.setOptions({ lang: { thousandsSep: ",", drillUpText: "? Back ", contextButtonTitle: "Download chart image" } }); var chart = new Highcharts.Chart(all_chart_options, chartCallback(all_chart_options)); }); jQuery.fn.extend({ addCommas: function addCommas(decimals) { var val = this[0] || 0; if (isNaN(val) || val < 999 && val > -999 && decimals < 1) { //small numbers auto decimals return val; } else if (val < 999 && val > -999 && decimals > 0) { //small numbers fixed decimals return val.toFixed(decimals); } else if ((val > 999 || val < -999) && decimals > 0) { //big numbers fixed decimals val = val.toFixed(decimals); while (/(\d+)(\d{3})/.test(val.toString())) { val = val.replace(/(\d+)(\d{3})/, '$1' + ',' + '$2'); } } else if (val > 999 || val < -999) { //big number auto decimals while (/(\d+)(\d{3})/.test(val.toString())) { val = val.toString().replace(/(\d+)(\d{3})/, '$1' + ',' + '$2'); } } return val; } });