We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Change font in one value or chart

I have generated a graph with xlsio and want to change the color of the label of the last of the axis data values.

            Dim serie1 As IChartSerie = chart.Series.Add("Serie1")
            serie1.DataPoints.DefaultDataPoint.DataLabels.IsValue = True
            serie1.DataPoints.DefaultDataPoint.DataLabels.Position = ExcelDataLabelPosition.Above
            serie1.DataPoints.DefaultDataPoint.DataLabels.Color = ExcelKnownColors.Dark_blue
            serie1.DataPoints.DefaultDataPoint.DataLabels.Bold = True

With this code I can change the style of all values, but want to change only the latter.
How can I do it?


Thanks.



3 Replies

AV Abirami Varadharajan Syncfusion Team August 1, 2016 10:37 AM UTC

Hi Juan, 
 
Thank you for contacting Syncfusion support. 
 
We request you to set the formatting to particular data point of the series. Kindly refer the below code snippet to achieve your requirement. 
 
Code Example: 
        Dim chart As IChart = workbook.Charts.Add() 
        chart.Series.Add(ExcelChartType.Column_Clustered) 
        chart.Series(0).CategoryLabels = sheet.Range("A3:A10") 
        chart.Series(0).Values = sheet.Range("B3:B10") 
 
        chart.Series.Add(ExcelChartType.Line) 
        chart.Series(1).CategoryLabels = sheet.Range("A3:A10") 
        chart.Series(1).Values = sheet.Range("E3:E10") 
 
        chart.Series(0).DataPoints.DefaultDataPoint.DataLabels.IsValue = True 
        chart.Series(1).DataPoints.DefaultDataPoint.DataLabels.IsValue = True 
        chart.Series(1).DataPoints(7).DataLabels.IsValue = True 
        chart.Series(1).DataPoints(7).DataLabels.Position = ExcelDataLabelPosition.Above 
        chart.Series(1).DataPoints(7).DataLabels.Color = ExcelKnownColors.Dark_blue 
        chart.Series(1).DataPoints(7).DataLabels.Bold = True 
 
We have also shared the sample for your reference which can be downloaded from the following location. Kindly refer and let us know if this helps. 
 
 
Regards, 
Abirami. 



JU Juan August 1, 2016 10:55 AM UTC

Thank you very much for the help!

I managed to
change it!

Greetings.


AV Abirami Varadharajan Syncfusion Team August 2, 2016 04:24 AM UTC

Hi Juan, 
 
Thank you for updating us. 
 
We are glad that your requirement is fulfilled. Please let us know if you need any further assistance. 
 
Regards, 
Abirami. 


Loader.
Up arrow icon