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.
Unfortunately, activation email could not send to your email. Please try again.

Change font in one value or chart

Thread ID:

Created:

Updated:

Platform:

Replies:

125203 Jul 29,2016 08:42 AM Aug 2,2016 12:24 AM ASP.NET Web Forms 3
loading
Tags: XlsIO
Juan
Asked On July 29, 2016 08:42 AM

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.



Abirami Varadharajan [Syncfusion]
Replied On August 1, 2016 06:37 AM

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. 


Juan
Replied On August 1, 2016 06:55 AM

Thank you very much for the help!

I managed to
change it!

Greetings.

Abirami Varadharajan [Syncfusion]
Replied On August 2, 2016 12:24 AM

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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;