أفضل مكتبة لاستخدام الرسم البياني هي apexcharts

 التثبيت والإصدار الممتاز:

    "apexcharts": "^3.45.2", => "3.13.2"

اقرأ أكثر من هنا....


هنا طريقة التثبيت على Angular
https://apexcharts.com/docs/angular-charts


الإصدارات الموصى بها:

    "apexcharts": "^3.13.2",

    "ng-apexcharts": "^1.8.0",





    "paths": {
      "apexcharts": ["node_modules/apexcharts"]
    },




            "scripts": [
              "node_modules/apexcharts/dist/apexcharts.min.js"
            ],


        FormsModule,
        ReactiveFormsModule,
        NgApexchartsModule,


      <apx-chart [series]="chartOptions.series" [chart]="chartOptions.chart" [xaxis]="chartOptions.xaxis"
        [title]="chartOptions.title"></apx-chart>


إعدادات الراديو:

  @ViewChild('chart') chart: ChartComponent;
  public chartOptions: Partial<ChartOptions>;

    this.chartOptions = {
      series: [
        {
          name: this.numberPoint,
          // color: '#A16537',
          data: values
        }
      ],
      chart: {
        height: 300,
        width: '100%',
        type: "radar",
        zoom: {
          enabled: true,
          type: 'x',
          autoScaleYaxis: false,
          zoomedArea: {
            fill: {
              color: '#90CAF9',
              opacity: 0.4
            },
            stroke: {
              color: '#0D47A1',
              opacity: 0.4,
              width: 1
            }
          }
        },
        toolbar: {
          show: false,
        },
        animations: {
          easing: 'linear'
        },
        events: {
          click: function (event, chartContext, config) {
          }
        }
      },
      title: {
        align: 'center',
        text: this.title
      },
      xaxis: {
        categories: categories
      }
    };



الـ Line:

  @ViewChild('chart'chartChartComponent;
  public chartOptionsPartial<ChartOptions>;

  constructor() {
    this.chartOptions = {
      series: [
        {
          name: 'image_url',
          data: series.monthDataSeries1.prices,
        },
        {
          name: 'secondary_heading',
          data: series.monthDataSeries2.prices,
        },
      ],
      chart: {
        type: 'line',
      },
      annotations: {
        points: [
          {
            x: new Date('14 Nov 2017').getTime(),
            y: 8900,
            marker: {
              size: 6,
              fillColor: '#fff',
              strokeColor: 'red',
              radius: 2,
            },
            label: {
              text: 'Data feature',
              borderColor: '#FF4560',
              offsetY: 0,
              style: {
                color: '#fff',
                background: '#FF4560',
              },
            },
          },
        ],
      },
      dataLabels: {
        enabled: false,
      },
      stroke: {
        curve: 'straight',
        width: 3,
      },
      grid: {
        padding: {
          right: 30,
          left: 20,
        },
      },
      title: {
        text: 'Notification anomalies',
        align: 'left',
      },
      labels: series.monthDataSeries1.dates,
      xaxis: {
        type: 'datetime',
      },
    };
  }


الـ Pie:

    this.chartOptions = {
      series: values,
      chart: {
        width: 380,
        type: "pie"
      },
      labels: _labels,
      responsive: [
        {
          breakpoint: 480,
          options: {
            chart: {
              width: 200
            },
            legend: {
              position: "bottom"
            }
          }
        }
      ]
    } as any;
















تعليقات

المشاركات الشائعة من هذه المدونة

ngx-extended-pdf-viewer

how to getting access token for https://fcm.googleapis.com/v1/projects/al-ayahya-co/messages:send for angular and backend nestjs

طريقة تفعيل زر Inline Keyboard في Telegram Bot