我怎样才能将每组列从低到高排序

时间:2016-03-09 01:35:17

标签: highcharts highcharts-ng

如何将每组列从低到高排序?

另外,我可以使用$ currency格式在工具提示中输入数字并删除浮点数吗?

非常感谢

inline

JS

  $scope.chartConfig = {
    options: {
      chart: {
        type: 'column'
      },
    },
    xAxis: {
        type: 'datetime',
        dateTimeLabelFormats: {
            day: '%b %e (%a)',
        },
    },

1 个答案:

答案 0 :(得分:1)

我使用了一些if else技巧来选择min和max:

void Dispose( bool disposing )
{ 
    if( bw.IsBusy ) {
       bw.CancelAsync();
    }

    bw.DoWork             -= new DoWorkEventHandler(bw_DoWork );
    bw.RunWorkerCompleted -= new RunWorkerCompletedEventHandler( bw_completed );
    bw.ProgressChanged    -= new ProgressChangedEventHandler( bw_ProgressChanged );

    // ...
    if( disposing ) {
        bw.Dispose();
        bw = null;
    }
} 

要显示$,只需使用工具提示下的格式化程序选项:

  for (i = 0; i < y1.length; i++) {
   if (y1[i] < y2[i])                  
      if (y1[i] < y3[i])               
         if (y2[i] < y3[i])   { 

            pushfct(yObj1,y1[i],color1, name1);
            pushfct(yObj2,y2[i], color2, name2);
            pushfct(yObj3,y3[i], color3, name3);

            }
         else                          
             {  

            pushfct(yObj1,y1[i], color1, name1);
            pushfct(yObj2,y3[i], color3, name3);
            pushfct(yObj3,y2[i], color2, name2);

             }
      else                         
          { 

            pushfct(yObj1,y3[i], color3, name3);
            pushfct(yObj2,y1[i], color1, name1);
            pushfct(yObj3,y2[i], color2, name2);
            }
   else                            
      if (y2[i] < y3[i])               
         if (y1[i] < y3[i])            
             {            
            pushfct(yObj1,y2[i], color2, name2);
            pushfct(yObj2,y1[i], color1, name1);
            pushfct(yObj3,y3[i], color3, name3);

             }
         else                      
             {            

            pushfct(yObj1,y2[i], color2, name2);
            pushfct(yObj2,y3[i], color3, name3);
            pushfct(yObj3,y1[i], color1, name1);
             }
      else                         
          {

            pushfct(yObj1,y3[i],color3, name3);
            pushfct(yObj2,y2[i], color2, name2);
            pushfct(yObj3,y1[i], color1, name1);
          }

  }

请查看示例(jsfiddle):

tooltip: {

    formatter:function(){
        return this.key +': $'+ this.y;
    }
},