![](/img/trans.png)
[英]Chart.js - How to parse array of objects as the dataset for Pie Chart
我有 Chart.js 和這種格式的圖表數據: 我如何解析我的數據以獲得像這樣的經典餅圖: 我試圖按照文檔進行操作,但它不可用。 這是我的模板: 這是我的 ts: ...
[英]Chart.js - How to parse array of objects as the dataset for Pie Chart
我有 Chart.js 和這種格式的圖表數據: 我如何解析我的數據以獲得像這樣的經典餅圖: 我試圖按照文檔進行操作,但它不可用。 這是我的模板: 這是我的 ts: ...
[英]Type 'Record<string, unknown>[]' is not assignable to type 'Plugin<any, AnyObject>[]'
我正在嘗試在我的 angular 項目中實現 chartJS,並且我正在使用 ng2-charts。 當我遵循此處編寫的文檔時: https://valor-software.com/ng2-charts/#GeneralInfo我的項目在注冊 DatalabelsPlugin 插件時崩潰了。 ...
[英]NG2-Charts - How to change cutout width for doughnut chart
我正在使用 Angular 14、ChartJS (4.1.2) 和 NG2-Charts (4.1.1) 開展公司項目。 我在嘗試更改圓環圖的寬度時遇到了一些麻煩。 我展示了我現在擁有的圖片: 這就是我應該做的: 此時我不需要在圖表里面放文字,我只是想縮小圖表的大小,讓里面的文字很合適。 我已 ...
[英]Chartjs Doughnut cutout option not working
我已將我的 chartjs 和 ng2-charts 從 2-* 升級到最新版本。 更新包后,在屬性中遇到了一些問題並修復了這些問題。 但在 Doughtnut 圖表中,cutout 選項不起作用。 根據文檔,我正在嘗試像素和百分比。 這是示例代碼Chart Js Version - ^4.1.2 ...
[英]ng2-charts - set default configuration
我正在嘗試使用 ng2-charts 設置默認配置。@NgModule({ ... imports: [ NgChartsModule.forRoot({ defaults: { plugins: { ...
[英]Click Event Not working below the x-axis line in chart Js (Angular)
我正在使用 Chart JS,嘗試在條形圖標簽中創建點擊事件,點擊事件在 x 軸下方不起作用,我嘗試在 canvas 中的點擊事件中實現此目的,但它不起作用 HTML 代碼: 圖表.ts: 插入圖片,綠色區域無法點擊 版本 Angular-14 ng-charts-4.0.1 chartjs-3.9 ...
[英]Angular11 update, ng2-charts, Error: Can't import the named export 'Chart' from non EcmaScript module (only default export is available)
我目前正在更新項目的 angular 版本。 它是 v10,我更新到 v11。 修復了許多錯誤,但 ng2-charts 不斷在 ng serve 上拋出這些錯誤。 我嘗試了許多不同版本的 ng2-charts、chart.js 和 @types/chart.js,但似乎沒有任何解決辦法。 pa ...
[英]Chart keeps flickering when setting data through method
我在 Angular 14 中使用 NG2-Charts 庫。問題是當我通過一種方法傳遞數據時,圖表中的顏色一直在閃爍。 這是問題的 stackblitz 鏈接: https://stackblitz.com/edit/labs-ng2-charts-3-zxvj4y?file=src%2Fapp% ...
[英]chart.js Scale Label not working Chart js in Angular 14
public barChartOptions: any = { responsive: true, maintainAspectRatio: false, scales: { yAxes: [ { grid: { display: ...
[英]Polar Area Chart with equal sized section
我想使用 ng2-charts 創建一個具有相同大小部分(不基於實際值)的極地區域圖:示例我認為使用 scales.r.max 設置為 1 會產生我需要的效果,但是任何超過最大值的數據都會溢出圖表的邊界而不是裁剪它。 有人知道如何實現這一目標嗎? 在此先感謝您的幫助, ...
[英]Refresh ng2-chart when new api call is made
我的條形圖是從 API 調用中填充的。 API 接受過濾器,因此,我希望在從下拉列表中選擇一個選項時更新圖表數據。 There is only data for 2022 so when another year is selected the chart is blank(which is ...
[英]Angular | ChartJs Annotation Plugin - Link the position of a line to the mouse
我嘗試使用注釋插件創建一個十字准線,我設法修改了我的線的值,但它沒有在圖表上更新。 這是我的圖表選項的概述:public financialChartOptions: ChartConfiguration['options'] = { plugins: { annotation: { ...
[英]Chart data will not load in ng2-charts/Chart.JS
我正在嘗試使用 ng2-charts 創建一個簡單的折線圖。 如果我對我的數據使用硬編碼數據,它就可以正常工作。 我正在嘗試使用一個變量,它是一個字符串數組,但是當我使用該變量而不是硬編碼數據時,它就不會加載。 我需要輸入更多內容才能提交帖子。 我不知道還能說什么。 如果您需要任何其他信息,請告訴 ...
[英]How to use both left and right yAxes in ng2-chart?
這是我的演示。 Output :我想要線跟隨右 yAxes 我按 ID 設置了 yAxes,但它不起作用。 百分比線仍然跟隨左 yAxes。 我哪里錯了? ...
[英]Basechart (Ng2-Charts) Canvas max width <= 16384px in Firefox?
我在stackblitz中准備了這個-https://stackblitz.com/edit/github-nlvlrr-mwudnj?file=src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.component.html,settsconfig. . 在 ...
[英]NG0303: Can't bind to 'type' since it isn't a known property of 'canvas'
我做了以下步驟: npm install ng2-charts@next --save 它安裝了 npm 安裝 chart.js --save 它安裝了 npm install --save-dev ng2-charts-schematics npm安裝 ng服務-o Angular版本為1 ...
[英]Show datalabels only if label value > 0
我有一個關於 ng2 圖表的問題。 這是我的component.ts文件。 這是我的component.html文件 這就是ng2 圖表的樣子 我希望,如果它們不是 0 ,則僅顯示這些值 如果我設置它可以工作 但如果我使用中心,我也想工作。 提前致謝 干杯 大衛 ...
[英]How to set cutout on doughnut chart using ng2-charts?
我需要一些幫助來弄清楚如何使用 ng2-charts 在我的圓環圖上設置配置選項。 特別是,我想在我的圖表上設置 cutout 屬性。 我已經閱讀了charts-js和ng2-charts的所有文檔,但不幸的是沒有找到可行的解決方案。 控制台拋出的錯誤是 輸入'{選項:{切口:數字; }; ...
[英]ChartConfiguration missing 'time' parameter in 'options.scales.x'
我正在從 chartjs 2.9.4 更新到 3.8.0,並且在ChartConfiguration對象上設置options.scales.x.time.unit參數時遇到錯誤。 當我第一次遇到這個問題時,我認為它與ng2-charts庫有關,但即使沒有使用這個庫,我也會遇到同樣的錯誤。 下面是 ...
[英]Highlight points in line chart thats value have out of range in ng2-charts
我想顯示折線圖,但不能應用超出范圍的邏輯。 如果血糖水平低於 120,則應以橙色點突出顯示該點。 如果血糖高於 180,則應以紅點突出顯示。 使用圖表:ng2-charts的折線圖 數據集: 試過的代碼: ...