Add Custom Color to pie-chart

I have requirement to add specific color to each element in pie-chart.
Below is my code for pie-chart with static json.
Instead of the default colors given by the viz charts, I want to have red, green, orange and blue color in the pie-chart.
Has someone changed the colors successfully?
var oModel = new sap.ui.model.json.JSONModel({
     businessData : [
               {Country :"Canada",revenue:2410.87, color: "red"},
                {Country :"China",revenue:638.29, color: "green"},
                {Country :"France",revenue:487.66, color: "orange"},
                {Country :"Germany",revenue:170.23, color: "blue"}
var oDataset = new sap.viz.ui5.data.FlattenedDataset({
         dimensions : [ {axis : 1, name : 'Country',  value : "{Country}" } ],
         measures : [ { name : 'Revenue',  value : '{revenue}' } ],
         data : { path : "/businessData" }
var oBarChart = new sap.viz.ui5.Pie({
          width : "80%", height : "400px",
          plotArea : {
                   'colorPalette' : d3.scale.category20().range()
           title : { visible : true, text : 'Revenue By Country' },
           dataset : oDataset
oBarChart.setModel(oModel);
oBarChart.placeAt("sample1");
Thanks,
Shashi

After lot of permutation and combination, I figured it out how to change the color.
Changing colorPalette to 'colorPalette' : ['#00B050','#CCFF66','#FF0000','#FFC300'], it worked
var oBarChart = new sap.viz.ui5.Pie({
          width : "80%", height : "400px",
          plotArea : {
                   'colorPalette' : ['#00B050','#CCFF66','#FF0000','#FFC300']
           title : { visible : true, text : 'Revenue By Country' },
           dataset : oDataset

Similar Messages

  • Custom Color Palette for Charts

    Hi all,
    Can I define the colors of a chart by a custom color palette in Design Studio (as you can do it in Web Intelligence) or does SAP intend to implement such a function in a next release? With CSS this isn't fully possible, because it doesn't allow you to coloring the additional line like the corresponding main line.
    I've already seen and commented this post Re: Custom Color Palette for Charts / CSS, but it's still unanswered. Maybe I've with a new discussion more success.
    Thank you and kind regards
    Silvan

    Carola,
    Dirk Mayrock has a nice list here Design Studio 1.1 Full List of CSS classes (?)
    I think you have seen that already.
    Also see Styling a chart in Design Studio
    Especially see participated David Gyurasz as he has answered several CSS questions CSS-Customizing of Column-Combination chart as an example
    Tammy

  • Custom Color Palette for Charts / CSS

    Is there a way of creating a custom color palette for charts (as you can do it in WebIntelligence) and install it on the tomcat?
    Or will I have to set my custom colors in the css? And if so: where can I find a description of classes for Charts? Is there any description of css classes at all? All I could find was a list of classes for a crosstab (but no description).
    Thank you
    Carola

    Carola,
    Dirk Mayrock has a nice list here Design Studio 1.1 Full List of CSS classes (?)
    I think you have seen that already.
    Also see Styling a chart in Design Studio
    Especially see participated David Gyurasz as he has answered several CSS questions CSS-Customizing of Column-Combination chart as an example
    Tammy

  • Customizing colour in Pie chart

    Hi Experts,
    In my scenario there is a Pie chart which shows the completion and pending of work in percentage. I have done this by creating a category and a series and the pie chart is getting displayed for completion and pending work in default colours. Now i want to customize these default colours, i need to display the completed status in Red and Pending status in green.
    If this is possible please help me out in achieving this.
    Thanks
    Sarathy.

    Hi Pandi,
    For changing the chart type, size, layout, color, shading and also creating the title for you Bussiness graphics you have to go for Customizing . Right Click the Bussiness Graphi UI and Choose  Edit chstomizing .
    and bind your customising id in the context .
    Go through this..
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/ca932ebc-0901-0010-68a0-b4dd81a4bf81?quicklink=index&overridelayout=true
    Also check this..
    Re: Color Of series in Pie chart
    Cheers,
    Kris.

  • Regarding standardization of Colors in Pie chart Categories

    Dear BI Experts,
    I have an issue regarding Pie Charts in the WAD. When we have 5 categories defined in the Pie chart and each category has got its own defined color.
    <b><u>issue no 1:</u></b> It is very difficult to go to each cahrt and select the colors for each chart in each category. Is there any place where we can define the colors in common?
    <b><u>issue no 2:</u></b> When we have the data for all the categories it is doing good. In case of data not available for any purticular category the color defined for that category is coming for the next category. which shud not happen.
    Is there any chance of solving this?
    Anyone please help me in this concern. Very much awaited.
    Regards,
    Kishore.

    Bhanu,
    Sorry about the late response ... connectivity issues....
    As for the color issue - you would have fixed colors to each series ... and when there is no data for one of them then that particular series is absent which would mean that the next series would take its place.
    Example :
    Original query -
    4 categories with 4 colors
    If one of the categories does not have data then the query would have 3 categories and category 4 would take the place of category 3 and hence the issue of the colors...
    I was not able to simulate the same however ....
    1. If you had the same data set in Excel - are the colors proper- any Standard data set / BeX chart
    2. Is there anyway you can fix the number of categories by way of restricted Key figures etc ? then if that category is present in the query even if there is not data the colors should be maintained.
    Arun
    Hope it helps...

  • Creating custom reports with Pie Chart

    Hello,
    I've got a little problem while I'm creating custom reports with SQL Chart.
    For example, I want to have a Pie Chart that represent the distribution of the version for a software, i wrote my query with no problem, the result is in good format.
    My Pie Chart is fine except there are no percentage displayed. The legend on the right is fine with correct count of different version, but no percentage on the pie chart.
    Any idea?
    Thanks in advance,
    Fab

    Hello,
    well, I think this is not possible to ask OEM to print the percentage over the chart.
    Anyway, I sugget you to rewrite your query to compute the % in the query itselft thus to have the pct displayed on the rigth.
    Let's say you want to display the database files' size with such a query: select file_name name,bytes val from dba_data_files;
    This is the way to display the % of each file size over the total (remark the above query has been embeded in the new one).
    select name,ratio_to_report(val) over() pct
    from ( select file_name name,bytes val from dba_data_files )
    order by val desc
    It is quite easy to adapt such a tip to your own query.
    Regards,
    Noel Talard

  • Custom colors for Keynote charts?

    I'm using the charts in Keynote for the first time, and I'm finding it surprising inflexible.
    As far as I can tell, I can not choose custom colors but have to choose between a few color sets chosen by Apple. Is that right?
    I would like 3 columns, with a 1, 2, 3 build order, in Red, White, and Blue. That seems pretty straightforward, but I can not see a way to make the red, white, and blue.
    thanks
    John
    PS: I really don't like the way that Jony Ives has imposed his personal preference for Helvetica Neue Light all over Apple products, applications, and websites.

    use the colour wheel to obtain million + colours:     Inspector > Format > Style > Fill

  • Default Colors of Pie Charts

    Dear all,
    we are very happy with the default colors of the pie charts in Oracle BI 10.
    After migrating the catalog to 11.1.1.5 the colors has changed to very dark color types.
    Is there an option to switch back to the old colors of a pie chart?
    Regards,
    Stefan

    Hi,
    Have a look at this blog: http://shivabizint.wordpress.com/2011/04/17/setting-default-graph-series-colors-in-obiee-11g/
    Regards

  • How to add dynamic visibility between pie chart and 2 bar charts?

    I have 3 section in pie chart. If i click on one section according bar chart have to appear...

    Hi Riaz,
    your subject-line and query seems to be different, please elaborate me the question properly so that i can explain you in clear in a single reply.
    For the query you have posted bar chart based on pie selection, if i understood your question clear. Goto File menu-->samples-->user guide samples-->Chart-Insertion will show the same what you have asked.
    Hope this Helps!!!
    --SumanT

  • Customizing Colors for a pie chat in webdynpro ABAP

    1. How to select different colors in pie chart for different categories?

    Hi Kishore you can customise your PIE chart if you are using the IGS.
    Chart designer
    You can customize the business graphics at the design time in view designer using the chart designer as well as the run time by using the interface u2018IF_WD_BUSIN_GRAPHICS_MTD_HNDLu2019 method. The chart designer will be called from the view designer by placing the cursor on the BG UI element and then right-click to select option u201CEdit Customizingu201D.
    check the following link on details of using Business Graphics in WD4A and at bottom there is customised editing step, which allows you flexibility to choose custom colors.
    [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/ca932ebc-0901-0010-68a0-b4dd81a4bf81]
    Greetings
    Prashant

  • Pie Chart in WEBI is Grey color

    Hi All,
    As part of my project requirement I need to develop a WebI report with Table and Pie chart.I selected the pie chart, intially it was in grey color and assigned the data to chart .When I tried to change the color of the chart it is not displaying colors.Please suggest me how to change the color of pie chart.
    As I gone through the posts in the SDN couldn't found much relevant information.
    Regards,
    Saroja

    Hi Saroja,
    I'm experiencing exactly the same problem. Did you by change find a solution in the meantime?
    P.S: I'm using Webi Rich Client version 14.0.9 build 1345
    Regards, Raimond

  • How to add custom barcolor in ProgressIndicator?

    Hi,
    I want to add custom color to barColor property of ProgressIndicator.
    How user defined color can be added to barColor?
    Thanks,
    Shashi

    Hi,
    Just add a styleclass.
    .sapMPIBarNeutral {
    background: linear-gradient(to bottom,#B8DBEE 0,#006ca7 100%);
    Or stick to the standard and change the "state" property.
    Kind regards,
    RW

  • How to allow custom colors to SSRS Pie-Chart?

    Hi,
     I have a pie-chart in my report.
    Can anybody please tell me How I can allow custom color to each part/slice of the piechart..??or How i can assign cutom pallete to pie-chart?
    BhushanBhushan

    Hi,
    I think u r using one data Field and One category Field in the Graph.
    Then We have use Code Option
    -----Add this in Code
    Private colorPalette As String() = { "Teal", "Gold", "Aqua"}
       Private count As Integer = 0
     Private mapping As New System.Collections.Hashtable()
      Public Function GetColor(ByVal groupingValue As String) As String
            If mapping.ContainsKey(groupingValue) Then
                Return mapping(groupingValue)
            End If
            Dim c As String = colorPalette(count Mod colorPalette.Length)
            count = count + 1
            mapping.Add(groupingValue, c)
            Return c
        End Function
    Finally add this Expression in the Fill Option. And we can add more colors in the Code based on no. of Category
    =Code.GetColor(Category_Field)
     for example =Code.GetColor(Fields!Zone.Value)
    Regards,
    Thiyagu
    I've done everything listed here and in the link provided, but I get an error that reads, "There is an error on line 0 of custom code: [BC30201] Expression expected." I'm using SSRS 2005.
    Does anyone know what this could be?

  • 2D Pie Charts losing assigned custom color

    APEX 3.0
    I have a 2D PieChart with custom colors of Green, Yellow and Red. It is made up up 3 series, series #1 counts new orders (Green), #2 - orders in jeopardy (Yellow) and #3 - orders that missed their shipped date (Red).
    If each series returns a count, then this works fine. If (for example) #2 doesn't return a row, then series #3 displays as Yellow instead of Red.
    On the other hand, 3D Piecharts handle this just fine.
    I personally like the 3D look, but the users want the 2D. Any advise?
    Thanks, Joe
    Message was edited by:
    joelanier

    Hello,
    1. Use the same Chart Color Theme for your charts
    2. Change your query so it always returns the same number of rows (so always, 1 and 2 and 3), even when there is no data : then return 0.
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • I am wanting to add an interactive pie chart to a custom form

    The pie chart or "wheel" is a visual for my project status form I want to share with clients. Can this be done? I only see an option to insert an image.
    thanks

    Currently we only support one field/item on a line. We are working on adding a feature that allows you to put multiple fields/items on a single line. We hope to have that out in a few months.
    Randy

Maybe you are looking for

  • Problems Only To Delete Records on DOE

    Hi, I have developed an application using SDOE_CONTACT* BAPI WRAPPERS (GETLIST, GETDETAIL, CREATE, MODIFY, DELETE). The application is running fine for GETLIST, GETDETAIL, CREATE and MODIFY, when I synchronize i can see the data reflecting on CDS and

  • User with Read-Only permission can write

    Hi, I have two Macs on a local network. I am sharing a folder on Mac-A and would like users to have read-only access to it. It is important that users cannot modify the data in this folder. On Mac-A: Selecting System Preferences->Sharing->File Sharin

  • New Spool Request not generating

    Dear All, I have seen print preview of one PO and taken print which has created a spool request. Another PO also I have seen the preview and taken print, but it has added to previous spool request as second page. My problem is I need to generate new

  • Node size zero then display date

    HI Experts If the node size is zero then i need to display current date in input field.Can any one send me the code. Thanks in Advance Kumar Edited by: kiran kumar on Dec 8, 2008 10:47 AM

  • CSCtz15274 - percentFLEXDSPRM-3-UNSUPPORTED_CODEC: codec cisco is not supported on dsp T38 - 1

    I have also been running into this on FXO to FXS calls with no local-bypass enabled.