2016-09-06 38 views
1

我讀過了Syncfusion的文檔,我似乎找不到添加工具提示Syncfusion圓形指示器指針的方法。因爲測量儀使用畫布繪製,並且同步庫很強烈,所以我沒有試過很多東西,除了閱讀和試驗有什麼之外,我只是不想在追逐陰影上花費太多時間。目前,在構建測量儀時,我正在像下面那樣拋出一些東西。我們已經實現了工具提示,但是讓它們與指針相關聯將是選擇。我不確定我現在可以提供什麼來提供更清晰。在使用Syncfusion時將工具提示添加到圓形指示器指針

.Scales(sc => 
    { 
     sc.StartAngle(180) 
     .SweepAngle(180) 
     .ShowRanges(true) 
     .ShowLabels(false) 
     .ShowPointers(showpointer) 
     .Radius(radius) 
     .Minimum(Model.Scaling.Min) 
     .Maximum(Model.Scaling.Max) 
     .ShowScaleBar(false) 
     .MajorIntervalValue(majorIntervalValue) 
     .Ticks(tick => 
     { 
      tick.Color("#FFFFFF").Height(0).Width(0).Add(); 
      tick.Color("#FFFFFF").Height(0).Width(0).Add(); 
     }) 
     .CustomLabels(cl => 
     { 
      cl.Value(String.Format(gaugeFormatString, gaugeValue)) 
      .Color("black") 
      .Font(f => f.Size("40px") 
         .FontFamily("Arial, Sans-Serif") 
         .FontStyle("bold") 
      ) 
      .Position(p => p.X(xLabelPosition).Y(yLabelPosition)).Add(); 
      //.Position(p => p.X(xLabelPosition)).Add(); 


      //.PositionBuilder() 
     }) 
     .Ranges(ran => 
     { 
      if (Model.Thresholds != null) 
      { 
       if (thresholdDirection) 
       { 
        if (gaugeValue <= (threshold * 100)) 
        { 
         ran.Size(gaugethickness).StartValue(0).EndValue(gaugeValue).BackgroundColor("#3AB54B").Border(bor => bor.Color("#3Ab54B")).Add(); 
         ran.Size(gaugethickness).StartValue(gaugeValue).EndValue(100).BackgroundColor("#B0D2C8").Border(bor => bor.Color("#B0D2C8")).Add(); 
        } 
        else if (gaugeValue < (secondaryThreshold * 100)) 
        { 
         ran.Size(gaugethickness).StartValue(0).EndValue(gaugeValue).BackgroundColor("#f5e132").Border(bor => bor.Color("#f5e132")).Add(); 
         ran.Size(gaugethickness).StartValue(gaugeValue).EndValue(100).BackgroundColor("#f1ecbc").Border(bor => bor.Color("#f1ecbc")).Add(); 
        } 
        else 
        { 
         ran.Size(gaugethickness).StartValue(0).EndValue(gaugeValue).BackgroundColor("#e60000").Border(bor => bor.Color("#e60000")).Add(); 
         ran.Size(gaugethickness).StartValue(gaugeValue).EndValue(100).BackgroundColor("#ff6666").Border(bor => bor.Color("#ff6666")).Add(); 
        } 
       } 
       else 
       { 
        if (gaugeValue >= (threshold * 100) && threshold > 0) 
        { 
         ran.Size(gaugethickness).StartValue(0).EndValue(gaugeValue).BackgroundColor("#3AB54B").Border(bor => bor.Color("#3Ab54B")).Add(); 
         ran.Size(gaugethickness).StartValue(gaugeValue).EndValue(100).BackgroundColor("#B0D2C8").Border(bor => bor.Color("#B0D2C8")).Add(); 
        } 
        else if (gaugeValue > (secondaryThreshold * 100) && secondaryThreshold > 0) 
        { 
         ran.Size(gaugethickness).StartValue(0).EndValue(gaugeValue).BackgroundColor("#f5e132").Border(bor => bor.Color("#f5e132")).Add(); 
         ran.Size(gaugethickness).StartValue(gaugeValue).EndValue(100).BackgroundColor("#f1ecbc").Border(bor => bor.Color("#f1ecbc")).Add(); 
        } 
        else 
        { 
         ran.Size(gaugethickness).StartValue(0).EndValue(gaugeValue).BackgroundColor("#e60000").Border(bor => bor.Color("#e60000")).Add(); 
         ran.Size(gaugethickness).StartValue(gaugeValue).EndValue(100).BackgroundColor("#ff6666").Border(bor => bor.Color("#ff6666")).Add(); 
        } 
       } 

      } 
      else 
      { 
       ran.Size(gaugethickness).StartValue(0).EndValue(gaugeValue).BackgroundColor("#428bca").Border(bor => bor.Color("#428bca")).Add(); 
       ran.Size(gaugethickness).StartValue(gaugeValue).EndValue(100).BackgroundColor("#a6bfd5").Border(bor => bor.Color("#a6bfd5")).Add(); 
      } 

     }) 
     .Pointers(po => 
     { 

      if (threshold > 0) 
      { 
       po.BackgroundColor("#3AB54B") 
         .Border(bor => bor.Color("#3AB54B").Width(0)) 
         .Type(PointerType.Marker) 
         .MarkerType(MarkerType.Rectangle) 
         .Length(5) 

         //.BackgroundColor(colorthresholdone) 
         .Width(gaugethickness + 10) 
         .Value(threshold * 100) 
         .DistanceFromScale(5) 
         .PointerValueText(pov => pov.ShowValue(false).Distance(-5) 
          .Opacity(1) 
          .autoAngle(false) 
          .Angle(0) 
          .Font(fo => fo.Size("15px") 
          .FontFamily("Arial, Sans-Serif") 
          .FontStyle("Normal") 
         ) 
          ) 
          .Add(); 
      } 
      if (secondaryThreshold > 0) 
      { 
       po.BackgroundColor("#f5e132") 
        .Border(bor => bor.Color("#f5e132").Width(0)) 
        .Type(PointerType.Marker) 
        .MarkerType(MarkerType.Rectangle) 
        .Length(5) 
        //.BackgroundColor(colorthreshholdtwo) 
        .Width(gaugethickness + 10) 
        .Value(secondaryThreshold * 100) 
        .DistanceFromScale(5) 
        .PointerValueText(pov => pov.ShowValue(false).Distance(-5) 
         .Opacity(1) 
         .autoAngle(false) 
         .Angle(0) 
         .Font(fo => fo.Size("15px") 
         .FontFamily("Arial, Sans-Serif") 
         .FontStyle("Normal") 
        ) 
        ) 
        .Add(); 
      } 
     }) 
     .Add(); 
    }) 

回答

0

抱歉給您帶來不便。到目前爲止,我們已經爲標籤提供了工具提示支持,並沒有提供對圓形指針中指針的支持,所以我們記錄了您的需求的功能請求,這將在我們即將發佈的任何Essential Studio版本中提供。有關這方面的更多信息,請在您的Syncfusion帳戶下創建支持事件以進行適當的跟進。

謝謝, Dharani。