Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
asp.net图表系列点标签字体格式_Asp.net_Mschart_Labels_Series - Fatal编程技术网

asp.net图表系列点标签字体格式

asp.net图表系列点标签字体格式,asp.net,mschart,labels,series,Asp.net,Mschart,Labels,Series,我目前正在使用下面所示的代码格式化图表系列点系列,但我看不到任何更改点标签文本字体的方法。 有人知道在哪里访问点标签的字体属性吗 'set the series point color dependent on value and retrieve the best & worst values Dim bestval As Double = 0.0 Dim worstval As Double = 0.0 For Each pt As DataPoint In

我目前正在使用下面所示的代码格式化图表系列点系列,但我看不到任何更改点标签文本字体的方法。 有人知道在哪里访问点标签的字体属性吗

'set the series point color dependent on value and retrieve the best & worst values
    Dim bestval As Double = 0.0
    Dim worstval As Double = 0.0
    For Each pt As DataPoint In cht.Series("MonthPL").Points
        'pt.IsValueShownAsLabel = True
        pt.Label = "#VALY{C0}"
        pt.LabelToolTip = "#AXISLABEL 's P/L is #VALY{C0}"
        If pt.YValues(0) < 0 Then
            If pt.YValues(0) < worstval Then worstval = pt.YValues(0)
            pt.Color = Color.Red
            pt.LabelForeColor = Color.Black
        Else
            If pt.YValues(0) > bestval Then bestval = pt.YValues(0)
            pt.Color = Color.DarkGreen
            pt.LabelForeColor = Color.GhostWhite
        End If
    Next
“根据值设置系列点颜色,并检索最佳值和最差值
Dim bestval为双精度=0.0
变暗worstval为双精度=0.0
对于每个pt作为cht系列(“MonthPL”)点中的数据点
'pt.IsValueShownAsLabel=True
pt.Label=“#VALY{C0}”
pt.LabelToolTip=“#AXISLABEL的P/L为#VALY{C0}”
如果pt.y值(0)<0,则
如果pt.Y值(0)最佳值,则最佳值=pt.Y值(0)
pt.Color=Color.DarkGreen
pt.LabelForeColor=Color.ghostwite
如果结束
下一个
您应该在这里看到它

pt.Font
我在c#中使用的实际代码是


声明一种新字体,并使用该字体:

Font myFont = new Font(FontFamily.Generic.SansSerif, 14, FontStyle.Bold);
然后将数据点的字体属性设置为:

pt.font = myFont;

插件系列标签为Font=“Zurich BT,11pt,style=Bold”

能否提供一个代码示例,包括如何将其添加到系列中?这将有助于澄清这一建议,并有助于将其与现有的两个答案相媲美。
pt.font = myFont;