我已经阅读了Syncfusion的文档,我似乎无法找到一种方法来添加Syncfusion Circle规范指针的工具提示。因为测量仪使用画布绘制而且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 :(得分:0)
很抱歉给您带来不便。
截至目前,我们已经为标签提供了工具提示支持,并且没有为圆形规格中的指针提供支持,因此我们记录了您的要求的功能请求,这将在我们即将发布的任何Essential Studio版本中提供。有关此问题的更多信息,请在您的Syncfusion帐户下创建一个支持事件,以便进行适当的跟进。
谢谢, 陀罗尼。