How to use the echarts.format function in echarts

To help you get started, we’ve selected a few echarts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apache / griffin / ui / js / controllers / health-ctrl.js View on Github external
controllers.controller('HealthCtrl', ['$scope', '$http', '$config', '$location','$timeout', '$route', '$barkChart', '$rootScope', function ($scope, $http, $config, $location, $timeout, $route, $barkChart, $rootScope) {
      console.log('health controller');
      // var url="/js/controllers/heatmap.json";

        var echarts = require('echarts');
        var formatUtil = echarts.format;
        
        $scope.isIE = function() {
            var ua = window.navigator.userAgent;
            var msie = ua.indexOf("MSIE ");
            if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)){
               return true; 
            }
            else {
               return false;
            }
        }

        pageInit();

        $scope.orgs = [];
        $scope.dataData = [];
github eBay / griffin / griffin-ui / js / controllers / detail-ctrl.js View on Github external
controllers.controller('DetailCtrl', ['$scope', '$http', '$config', '$location','$timeout', '$route', '$barkChart', '$rootScope','$routeParams', function ($scope, $http, $config, $location, $timeout, $route, $barkChart, $rootScope,$routeParams) {
      console.log('detail controller');
      // var url="/js/controllers/heatmap.json";

        var echarts = require('echarts');
        var formatUtil = echarts.format;

        if($rootScope.showBigChart==undefined)
        {
            $rootScope.showBigChart = function(option) {
                $scope.selectedModel = option.title.text;
                $('#bigChartContainer').show();
                // $('#mainWindow').hide();
                $rootScope.bigChart.clear();
                $rootScope.bigChart.setOption(option);
            }
        }

        var showBig = function(metricName){
          var metricDetailUrl = $config.uri.metricdetail + '/' + metricName;
          $http.get(metricDetailUrl).success(function (data){
            $rootScope.showBigChart($barkChart.getOptionBig(data));
github mpw0311 / antd-umi-sys / src / components / Charts / CalendarPie / index.js View on Github external
getVirtulData(time, data) {// eslint-disable-line
        const { rows = [] } = data;
        const date = +echarts.number.parseDate(time[0]);
        const end = +echarts.number.parseDate(time[time.length - 1]);
        const dayTime = 3600 * 24 * 1000;
        const dd = [];
        for (let time = date; time <= end; time += dayTime) {
            const formatTime = echarts.format.formatTime('yyyy-MM-dd', time);
            let value = [0, 0];
            for (let v of rows) {
                const { date, match, unmatch } = v;
                if (date === formatTime) {
                    value = [match, unmatch];
                    break;
                }
            }
            dd.push([
                formatTime,
            ].concat(value));
        }
        return dd;
    }
    getSeries(dataRange, scatterData) {
github mpw0311 / antd-umi-sys / src / components / Chart / Calendar-pie.js View on Github external
getVirtulData(time, data) {// eslint-disable-line
        const { rows = [] } = data;
        const date = +echarts.number.parseDate(time[0]);
        const end = +echarts.number.parseDate(time[time.length - 1]);
        const dayTime = 3600 * 24 * 1000;
        const dd = [];
        for (let time = date; time <= end; time += dayTime) {
            const formatTime = echarts.format.formatTime('yyyy-MM-dd', time);
            let value = [0, 0];
            for (let v of rows) {
                const { date, match, unmatch } = v;
                if (date === formatTime) {
                    value = [match, unmatch];
                    break;
                }
            }
            dd.push([
                formatTime,
            ].concat(value));
        }
        return dd;
    }
    getSeries(dataRange, scatterData) {
github suweiteng / vue2-management-platform / src / views / index / echarts.vue View on Github external
function getVirtulData() {
          var date = +echarts.number.parseDate('2017-02-01');
          var end = +echarts.number.parseDate('2017-03-01');
          var dayTime = 3600 * 24 * 1000;
          var data = [];
          for (var time = date; time < end; time += dayTime) {
            data.push([
              echarts.format.formatTime('yyyy-MM-dd', time),
              Math.floor(Math.random() * 10000)
            ]);
          }
          return data;
        }
github node-honeycomb / honeycomb-console / assets / scenes / list / linechart.jsx View on Github external
formatter: (name) => {
          return echarts.format.truncateText(name, 35, '10px Microsoft Yahei', '…');
        },
        tooltip: {
github zuiidea / antd-admin / src / pages / chart / ECharts / TreemapComponent.js View on Github external
{
              value: 8,
              name: 'GenericAddressHandler.addresshandler',
              path: 'Recents/Plugins/GenericAddressHandler.addresshandler',
            },
            {
              value: 12,
              name: 'MapsRecents.addresshandler',
              path: 'Recents/Plugins/MapsRecents.addresshandler',
            },
          ],
        },
      ],
    },
  ]
  let formatUtil = echarts.format
  function getLevelOption() {
    return [
      {
        itemStyle: {
          normal: {
            borderWidth: 0,
            gapWidth: 5,
          },
        },
      },
      {
        itemStyle: {
          normal: {
            gapWidth: 1,
          },
        },
github hustcc / echarts-for-react / demo / src / charts / Gcalendar.jsx View on Github external
getVirtulData = (year) => {
    year = year || '2017';
    const date = +echarts.number.parseDate(year + '-01-01');
    const end = +echarts.number.parseDate((+year + 1) + '-01-01');
    const dayTime = 3600 * 24 * 1000;
    const data = [];
    for (let time = date; time < end; time += dayTime) {
        data.push([
            echarts.format.formatTime('yyyy-MM-dd', time),
            Math.floor(Math.random() * 1000)
        ]);
    }
    return data;
  };
  getOption = () => {
github opennode / waldur-homeport / app / scripts / components / resource / support / ResourcesTreemap.tsx View on Github external
import echarts from 'echarts';
import * as React from 'react';

import { ngInjector, ENV } from '@waldur/core/services';
import { connectAngularComponent } from '@waldur/store/connect';

const formatUtil = echarts.format;

function getLevelOption() {
  return [
      {
          itemStyle: {
              normal: {
                  borderColor: '#777',
                  borderWidth: 0,
                  gapWidth: 1,
              },
          },
          upperLabel: {
              normal: {
                  show: false,
              },
          },