Highcharts是一个使用HTML,SVG和VML的Javascript图表库。该编辑器提供该产品的开源/非营利和商业版本。
highcharts 没有导出成员“ChartObject”
我想为我的 Angular 4 项目设置 highcharts,但我不断收到此错误: highcharts 没有导出成员“ChartObject” 我努力了, 角高图表, Highcharts-angualr, ng2-
自定义数据标签 SVG 不会出现在导出 png 或 pdf highcharts 中
我有倒立柱形图,在每个数据点的末尾,我设置了自定义 SVG 图标以及一些文本 绘图选项:{ 柱子: { 点宽度:1, 光标:'指针', 数据标签:{ ...
我在高图表的工具提示上有一个按钮。 我想更改按钮单击时特定点的工具提示。 我在高图表的工具提示上有一个按钮。 我想更改按钮单击特定点的工具提示。 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Highcharts Editable Data Label</title> <script src="https://code.highcharts.com/highcharts.js"></script> <script src="https://code.highcharts.com/modules/exporting.js"></script> <script src="https://code.highcharts.com/modules/export-data.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> </head> <body> <div id="container" style="width: 600px; height: 400px;"></div> 以下是脚本 Highcharts.AST.bypassHTMLFiltering = true; Highcharts.chart('container', { chart: { type: 'line' }, tooltip: { useHTML: true, formatter: function() { // Return the default tooltip content var tooltip = '<b>' + this.series.name + '</b><br/>' + Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' + Highcharts.numberFormat(this.y, 2); // Add a button to the tooltip tooltip += '<br/><button onclick="changeTooltip(' + this.point.index + ')">Change Tooltip</button>'; return tooltip; }, style: { pointerEvents: 'auto' } }, 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] }] }); // Function to change tooltip for a specific point function changeTooltip(pointIndex) { Highcharts.charts[0].update({ tooltip: { formatter: function() { // Customize tooltip for this point return 'Customized Tooltip for Point '; }, useHTML: true }}) } 我已经尝试过上面的代码,但是当单击按钮时,所有点的工具提示都会发生变化。 也尝试过 point.update({tooltip: { formatter: function() { // Customize tooltip for this point return 'Customized Tooltip for Point '; }, useHTML: true }}); 但是什么也没发生 有多种方法可以做到这一点。 我在这里所做的方法是对代码进行三处更改: 添加一个名为 customToolTips 的全局数组变量 在你的changeTooltip()中设置该变量 访问格式化程序中的变量:function() 查看代码片段中的编辑。 请注意,单击“更改工具提示”按钮后,您必须离开该点然后再返回该点,才能看到新的工具提示文本。 Highcharts.AST.bypassHTMLFiltering = true; Highcharts.chart('container', { chart: { type: 'line' }, tooltip: { useHTML: true, formatter: function() { // Return the default tooltip content var tooltip = '<b>' + this.series.name + '</b><br/>' if( customToolTips.length > this.point.index && customToolTips[this.point.index] ) { // Add the custom tooltip text tooltip += customToolTips[this.point.index]; } else { // Original (non-custom) text tooltip += Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' } tooltip += Highcharts.numberFormat(this.y, 2); // Add a button to the tooltip tooltip += '<br/><button onclick="changeTooltip(' + this.point.index + ')">Change Tooltip</button>'; return tooltip; }, style: { pointerEvents: 'auto' } }, 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] }] }); let customToolTips = []; // Function to change tooltip for a specific point function changeTooltip(pointIndex) { // NOTE Store some custom text customToolTips[pointIndex] = `<div class="Custom">THIS IS CUSTOM for #${pointIndex}</div>`; } .container { margin: 10px; border: solid 4px yellow; } .Custom { color: red; } <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <script src="https://code.highcharts.com/highcharts.js"></script> <script src="https://code.highcharts.com/modules/exporting.js"></script> <script src="https://code.highcharts.com/modules/export-data.js"></script> <div id="container" style="width: 600px; height: 400px;"></div>
Highcharts - 我可以在同一 x 轴和 y 轴上拥有多个时间线的图表吗?
我想创建一个有n条时间线的图表,只有一个y轴和一个y轴,这样我就可以将它们与相同的日期范围进行比较。 我尝试组合两个图表(线图和散点图),并且我得到了
更改 Highcharts 地图上的地图颜色,并根据最小值和最大值显示颜色
我有一个vue项目,我试图在世界地图上显示数据,但我无法更改地图上的颜色。我希望地图在 colorAxis 选项中使用 minColor 和 maxColor 但它...
我正在尝试将 REST API 中的一些数据输入 HighCharts,但收到错误:TypeError:无法读取未定义的属性“系列”。 从 API 获取数据: $scope.myData = 函数...
Highcharts.js - 在子弹图中,将目标线设为虚线
在 Highcharts 中,我想创建一个子弹图。 但我希望目标线是虚线。 我在目标 API 中没有看到这样的选项。 目标 API 链接:https://api.highcharts.com/highcharts/series。
Highcharts 在 y 轴上自定义缩放 - 线性和对数的混合
我尝试在图表上使用对数刻度,如下所示: 然而,出站数据远低于入站数据。这在图表中没有正确显示,使它看起来像有
我想在堆栈条形图上显示所有堆栈标签 我使用以下属性: y 轴:{ 反向堆栈:假, 分钟:0, 堆栈标签:{ endOnTick:这个。
如何在python中使用Dash获取highcharts的hover clickData?
任何人都可以帮助我,如何通过使用破折号和Python单击highchart图的任意点来获取悬停数据。下面给出了用于绘制高图表条形图的代码和数据集。 输入
我正在使用 highchart,我想隐藏 x 轴类别(图表底部的数字,请参阅下图参考)。 有谁知道怎么隐藏吗
我有一个来自 highcharts lib 的箱线图。这是我的组件和数据: Highcharts.chart('容器', { 图表: { 类型:'箱线图', “宽度”:165 }, 标题: { ...
这是我生成的html 函数 loadHighchartsScript() { var script = document.createElement('script'); ...</desc> <question vote="0"> <p>这是我生成的 html </p> <pre><code> <script> function loadHighchartsScript() { var script = document.createElement('script'); script.src = 'https://code.jquery.com/jquery-3.6.4.min.js'; script.async = true; document.head.appendChild(script); var script2 = document.createElement('script'); document.head.appendChild(script2); script2.src = 'https://code.highcharts.com/highcharts.js'; script2.async = true; document.head.appendChild(script2); var script3= document.createElement('script'); script3.src = 'https://code.highcharts.com/modules/exporting.js'; script3.async = true; document.head.appendChild(script3); } loadHighchartsScript(); </script><script src="https://code.jquery.com/jquery-3.6.4.min.js" async=""></script><script src="https://code.highcharts.com/highcharts.js" async=""></script><script src="https://code.highcharts.com/modules/exporting.js" async=""></script> </head> <body> <div id="container" data-highcharts-chart="0" style="overflow: hidden;"><div id="highcharts-zyf9724-0" dir="ltr" style="position: relative; overflow: hidden; width: 452px; height: 190px; text-align: left; line-height: normal; z-index: 0; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); user-select: none; touch-action: manipulation; outline: none;" class="highcharts-container "><svg version="1.1" class="highcharts-root" style="font-family: Helvetica, Arial, sans-serif; font-size: 1rem;" xmlns="http://www.w3.org/2000/svg" width="452" height="190" viewBox="0 0 452 190"><desc>Created with Highcharts 11.4.3</desc><defs><filter id="highcharts-drop-shadow-0"><feDropShadow dx="1" dy="1" flood-color="#000000" flood-opacity="0.75" stdDeviation="2.5"></feDropShadow></filter></defs><g class="highcharts-grid highcharts-xaxis-grid" data-z-index="1"></g><g class="highcharts-grid highcharts-yaxis-grid" data-z-index="1"></g><g class="highcharts-axis highcharts-xaxis" data-z-index="2"><path fill="none" class="highcharts-axis-line" stroke="#333333" stroke-width="1" data-z-index="7"></path></g><g class="highcharts-axis highcharts-yaxis" data-z-index="2"></g><text x="226" text-anchor="middle" class="highcharts-title" data-z-index="4" style="font-size: 1.2em; color: rgb(51, 51, 51); font-weight: bold; fill: rgb(51, 51, 51);" y="25"></text><text x="226" text-anchor="middle" class="highcharts-subtitle" data-z-index="4" style="color: rgb(102, 102, 102); font-size: 0.8em; fill: rgb(102, 102, 102);" y="24"></text><text x="10" text-anchor="start" class="highcharts-caption" data-z-index="4" style="color: rgb(102, 102, 102); font-size: 0.8em; fill: rgb(102, 102, 102);" y="187"></text><g class="highcharts-legend highcharts-no-tooltip" data-z-index="7" transform="translate(185,148)"><rect fill="none" class="highcharts-legend-box" rx="0" ry="0" stroke="#999999" stroke-width="0" filter="none" x="0" y="0" width="81" height="27"></rect><g data-z-index="1"><g><g class="highcharts-legend-item highcharts-line-series highcharts-color-undefined highcharts-series-0" data-z-index="1" transform="translate(8,3)"><path fill="none" class="highcharts-graph" stroke-width="2" stroke-linecap="round" d="M 1 12 L 15 12" stroke="#BFBFBF"></path><path fill="#BFBFBF" d="M 8 16 A 4 4 0 1 1 8.000199999999918 15.999999995 Z" class="highcharts-point" stroke="#ffffff" stroke-width="0" opacity="1"></path><text x="21" text-anchor="start" data-z-index="2" style="color: rgb(51, 51, 51); cursor: pointer; font-size: 11px; text-decoration: none; font-family: Calibri; fill: rgb(51, 51, 51);" y="15">NFI-ODCE</text></g></g></g></g><g class="highcharts-axis-labels highcharts-xaxis-labels" data-z-index="7"><text x="0" text-anchor="middle" transform="translate(0,0)" style="color: rgb(51, 51, 51); cursor: default; font-size: 11px; font-family: Calibri; fill: rgb(51, 51, 51);">3Q21</text><text x="0" text-anchor="middle" transform="translate(0,0)" style="color: rgb(51, 51, 51); cursor: default; font-size: 11px; font-family: Calibri; fill: rgb(51, 51, 51);">4Q21</text><text x="0" text-anchor="middle" transform="translate(0,0)" style="color: rgb(51, 51, 51); cursor: default; font-size: 11px; font-family: Calibri; fill: rgb(51, 51, 51);">1Q22</text><text x="0" text-anchor="middle" transform="translate(0,0)" style="color: rgb(51, 51, 51); cursor: default; font-size: 11px; font-family: Calibri; fill: rgb(51, 51, 51);">2Q22</text><text x="0" text-anchor="middle" transform="translate(0,0)" style="color: rgb(51, 51, 51); cursor: default; font-size: 11px; font-family: Calibri; fill: rgb(51, 51, 51);">3Q22</text><text x="0" text-anchor="middle" transform="translate(0,0)" style="color: rgb(51, 51, 51); cursor: default; font-size: 11px; font-family: Calibri; fill: rgb(51, 51, 51);">4Q22</text><text x="0" text-anchor="middle" transform="translate(0,0)" style="color: rgb(51, 51, 51); cursor: default; font-size: 11px; font-family: Calibri; fill: rgb(51, 51, 51);">1Q23</text><text x="0" text-anchor="middle" transform="translate(0,0)" style="color: rgb(51, 51, 51); cursor: default; font-size: 11px; font-family: Calibri; fill: rgb(51, 51, 51);">2Q23</text><text x="0" text-anchor="middle" transform="translate(0,0)" style="color: rgb(51, 51, 51); cursor: default; font-size: 11px; font-family: Calibri; fill: rgb(51, 51, 51);">3Q23</text><text x="0" text-anchor="middle" transform="translate(0,0)" style="color: rgb(51, 51, 51); cursor: default; font-size: 11px; font-family: Calibri; fill: rgb(51, 51, 51);">4Q23</text></g><g class="highcharts-axis-labels highcharts-yaxis-labels" data-z-index="7"></g></svg></div></div> <script> function renderChart() { var chartConfig = {"chart":{"height":190,"width":452},"title":{"text":""},"credits":{"enabled":false},"xAxis":{"categories":["3Q21","4Q21","1Q22","2Q22","3Q22","4Q22","1Q23","2Q23","3Q23","4Q23"],"labels":{"style":{"fontSize":"11px","fontFamily":"Calibri"}}},"yAxis":{"title":{"text":""},"labels":{"style":{"fontSize":"11px","fontFamily":"Calibri"},"formatter":"function(){return this.value / 1000000 + \u0027M\u0027;}"}},"legend":{"itemStyle":{"fontSize":"11px","fontFamily":"Calibri"},"itemHeight":12,"itemMarginTop":1,"itemMarginBottom":1},"series":[{"name":"NFI-ODCE","color":"#BFBFBF","data":[4793403562,4873403562,5096570645,5188346684,4994094697,4602946358,4326011268,4138145751,3897573489,3433337175],"dataLabels":{"enabled":true,"style":{"fontSize":"11px","fontFamily":"Calibri"},"allowOverlap":false}}]}; Highcharts.chart('container', chartConfig); } // Call renderChart() once the Highcharts script is loaded asynchronously window.addEventListener('load', renderChart); </script> </body></html> </code></pre> <p>但由于某种原因,我遇到了这个愚蠢的错误 highcharts.js:8 Uncaught TypeError: f.formatter.call is not a function</p> </question> <answer tick="false" vote="0"> <p>公共静态异步任务 GrowthNetAssetValue() {// 预处理数据以将值转换为数百万</p> <pre><code> var chartConfig = new { chart = new { height = 190, width = 452 }, title = new { text = "" }, // Set height and width for the chart and an empty title credits = new { enabled = false }, xAxis = new { categories = new[] { "3Q21", "4Q21", "1Q22", "2Q22", "3Q22", "4Q22", "1Q23", "2Q23", "3Q23", "4Q23" }, labels = new { style = new { fontSize = "11px", fontFamily = "Calibri" } } // Set font size and type for x-axis labels }, yAxis = new { title = new { text = "" }, labels = new { style = new { fontSize = "11px", fontFamily = "Calibri" }, formatter = "function()" + "{" + "return this.value / 1000000 + 'M';" + "}" } }, legend = new { itemStyle = new { fontSize = "11px", fontFamily = "Calibri" }, // Set font size and type for legend items itemHeight = 12, // Adjust the height of legend items itemMarginTop = 1, // Adjust the top margin of legend items itemMarginBottom = 1 // Adjust the bottom margin of legend items }, series = new[] { new { name = "NFI-ODCE", color = "#BFBFBF", data = new double?[] { 4793403562, 4873403562, 5096570645, 5188346684, 4994094697, 4602946358, 4326011268, 4138145751, 3897573489, 3433337175 }, dataLabels = new { enabled = true, style = new { fontSize = "11px", fontFamily = "Calibri" }, allowOverlap = false, }, } } }; HighchartsImageExporter imageExporter = new HighchartsImageExporter(); byte[] chartImageBytes = await imageExporter.ExportChartAsImageBytes(chartConfig); return Convert.ToBase64String(chartImageBytes); } </code></pre> </answer> </body></html>
有没有办法让我的 highcharter 图表在 y 轴和工具提示上有千位分隔符?不确定是否有单独的方法可以做到这一点,或者是否有全局选项。工具提示...
有没有办法通过名称或ID删除系列?我的意思是可以通过 this.remove() 删除系列 或者 var 系列长度=图表.系列.长度; for(var i = seriesLength - 1; i > -1; i--) ...
如何在 HighCharts 中动态更改数据系列而不覆盖初始系列?
HighCharts 新手。 我有一个柱形图,我希望能够将业务数据的各个子集插入到柱中。 对于这个测试,我的数据系列是: 常量原始数据 = [ {y:0.033,
我试图让图例显示该系列的分组值,并在范围更改时动态更新它。 通过更改范围,我的意思是单击范围选择器,移动
我正在尝试使用选项卡更改上的不同数据更新相同的图表。 所以我的父组件具有这种形式的子组件 app-chart-metric-view 。我已经包含了选项卡事件检测...
在我的高图表中,当我包含导出选项时,它在上下文菜单中包含数据表。如果我尝试包含 MenuItems ,那么我将失去导出到 excel 和 CSV 的选项。 怎么...
我有一个瀑布图,我需要删除图表上出现的系列 1。 我已经尝试过: 传奇: { 启用:假 }, 和 显示图例:假, 但还是出现了。 图表: { 类型:“瀑布” },