{"id":1191,"date":"2010-03-25T03:52:28","date_gmt":"2010-03-25T08:52:28","guid":{"rendered":"http:\/\/www.cognitiveinfo.com\/?p=7"},"modified":"2010-03-25T03:52:28","modified_gmt":"2010-03-25T08:52:28","slug":"add-a-custom-chart-palette-to-cognos","status":"publish","type":"post","link":"http:\/\/cognitiveinfo.com\/?p=1191","title":{"rendered":"Add a custom chart palette to Cognos."},"content":{"rendered":"<p>While Cognos does many things well, most people have different tastes in colors.\u00a0 This article will walk you through creating and installing a custom chart palette.\u00a0 This example is for general charts, but the principles can be applied to maps and gauges in the same XML files.<\/p>\n<p>Example Charts &#8216;Before&#8217; and &#8216;After&#8217;<\/p>\n<figure id=\"attachment_13\" aria-describedby=\"caption-attachment-13\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.cognitiveinfo.com\/wp-content\/uploads\/2010\/03\/CognosCharts_sm.gif\"><img fetchpriority=\"high\" decoding=\"async\" class=\"size-medium wp-image-13\" title=\"Custom Cognos Chart Palette\" alt=\"Custom Cognos Chart Palette\" src=\"http:\/\/www.cognitiveinfo.com\/wp-content\/uploads\/2010\/03\/CognosCharts_sm-300x197.gif\" width=\"300\" height=\"197\" \/><\/a><figcaption id=\"caption-attachment-13\" class=\"wp-caption-text\">Custom Cognos Chart Palette<\/figcaption><\/figure>\n<p>1. Choose your colors.<\/p>\n<p>These colors are from the &#8216;Barn&#8217; palette and others I found at <a href=\"http:\/\/www.colourlovers.com\/\" target=\"_blank\" rel=\"noopener\">Colour Lovers<\/a><br \/>\nThey have great palettes to get you started.<br \/>\n2. Edit ChartPalettes.xml<br \/>\nIn windows this file is found in:<br \/>\nC:\\Program Files\\Cognos\\c8\\webcontent\\pat\\res<\/p>\n<p>3. You can either create a new palette or just edit the pre-installed ones to suit your color preferences.<br \/>\nIn the XML document, explanation of &lt;namedChartPalette&gt; tag properties:<br \/>\nid\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0unique identifier<br \/>\nlabel\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0the label of the palette which will show up in Report Studio when you choose a palette.<br \/>\nidsLabel\u00a0\u00a0 \u00a0string resource id for the label, as defined in reportstudio_xx.xml files.<br \/>\ntooltip\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0the tooltip<br \/>\nidsTooltip\u00a0\u00a0 \u00a0string resource id for the tooltip, as defined in reportstudio_xx.xml files.<\/p>\n<p>The idsLabel and idsTooltip you assign here will be used later in to create the actual text label.<\/p>\n<p>4. The complete palette section will look like this:<br \/>\n&lt;namedChartPalette id=&#8221;normalMyCompany&#8221; smallIcon=&#8221;chart\/palette\/normal\/mycompanypalette.gif&#8221; idsLabel=&#8221;IDS_PAL_NAME_MyCompany&#8221; idsTooltip=&#8221;IDS_PAL_TOOLTIP_MyCompany&#8221;&gt;<br \/>\n&lt;chartPalette&gt;<br \/>\n&lt;chartColor value=&#8221;#C25C4F&#8221;\/&gt;<br \/>\n&lt;chartColor value=&#8221;#E9D699&#8243;\/&gt;<br \/>\n&lt;chartColor value=&#8221;#B9B964&#8243;\/&gt;<br \/>\n&lt;chartColor value=&#8221;#826481&#8243;\/&gt;<br \/>\n&lt;chartColor value=&#8221;#70635A&#8221;\/&gt;<br \/>\n&lt;chartColor value=&#8221;#EF2263&#8243;\/&gt;<br \/>\n&lt;chartColor value=&#8221;#D54A5C&#8221;\/&gt;<br \/>\n&lt;chartColor value=&#8221;#828425&#8243;\/&gt;<br \/>\n&lt;chartColor value=&#8221;#A2C1D5&#8243;\/&gt;<br \/>\n&lt;chartColor value=&#8221;#BFEBEF&#8221;\/&gt;<br \/>\n&lt;\/chartPalette&gt;<br \/>\n&lt;\/namedChartPalette&gt;<\/p>\n<p>5.\u00a0 Add a text name for the palette.<br \/>\nEdit reportstudio_en.xml in same directory.<br \/>\nThe &#8216;_en&#8217; designates the English file.\u00a0 Repeat as needed for other language files.<\/p>\n<p>6.\u00a0\u00a0 \u00a0Search and find the section of name tags by seaching for &#8220;IDS_PAL_NAME_default&#8221;<br \/>\nBelow that, add 2 new tags:<br \/>\n&lt;string id=&#8221;IDS_PAL_NAME_MyCompany&#8221; type=&#8221;Control Label&#8221;&gt;My Company palette&lt;\/string&gt;<br \/>\n&lt;string id=&#8221;IDS_PAL_TOOLTIP_MyCompany&#8221; type=&#8221;Control Label&#8221;&gt;My Company Barn palette.&lt;\/string&gt;<\/p>\n<p>7. Create a custom palette icon for Report Studio and save as a GIF image.<br \/>\nImages are 48 x 16 pixels with a sample of each color.<br \/>\nI used one of the ones that Cognos installed and filled it in with my colors in a photo editing software.<br \/>\nName the GIF exactly as specified in the opening tag for your palette the ChartPalettes.xml<br \/>\nIn this example we used smallIcon=&#8221;chart\/palette\/normal\/mycompanypalette.gif&#8221;<\/p>\n<p>8.\u00a0\u00a0 \u00a0Save or upload the image to your server.<br \/>\nIn Windows servers save it to:<br \/>\nC:\\Program Files\\Cognos\\c8\\webcontent\\pat\\images\\chart\\palette\\normal<\/p>\n<p>Here is what the\u00a0 menu will show once we finish.<\/p>\n<figure id=\"attachment_12\" aria-describedby=\"caption-attachment-12\" style=\"width: 285px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.cognitiveinfo.com\/wp-content\/uploads\/2010\/03\/custompalette.gif\"><img decoding=\"async\" class=\"size-medium wp-image-12\" title=\"New Custom Palette\" alt=\"New Custom Palette in palette dialog box\" src=\"http:\/\/www.cognitiveinfo.com\/wp-content\/uploads\/2010\/03\/custompalette-285x300.gif\" width=\"285\" height=\"300\" \/><\/a><figcaption id=\"caption-attachment-12\" class=\"wp-caption-text\">New Custom Palette in palette dialog box<\/figcaption><\/figure>\n<p>9. Restart your Cognos service.<\/p>\n<p>If you just changed color codes in the preinstalled &#8216;normalDefault&#8217; palette, now all your charts.<br \/>\nIf you followed all the steps and added a new palette as above, it will now be available in Report Studio.<br \/>\nTo test it, open Report Studio, create a new chart and look in the properties for &#8216;Palette: &#8230;&#8217;<br \/>\nClick the elipses to to see the palette menu.<br \/>\nIn the drop down you should now see &#8216;My Company palette&#8217; as one of the options with your image preview.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While Cognos does many things well, most people have different tastes in colors.\u00a0 This article will walk you through creating and installing a custom chart palette.\u00a0 This example is for general charts, but the principles can be applied to maps and gauges in the same XML files. Example Charts &#8216;Before&#8217; and &#8216;After&#8217; 1. Choose your [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":13,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[20,21,35,37,77],"class_list":["post-1191","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cognos","tag-8-3","tag-8-4","tag-charts","tag-cognos","tag-report-studio"],"_links":{"self":[{"href":"http:\/\/cognitiveinfo.com\/index.php?rest_route=\/wp\/v2\/posts\/1191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/cognitiveinfo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/cognitiveinfo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/cognitiveinfo.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/cognitiveinfo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1191"}],"version-history":[{"count":0,"href":"http:\/\/cognitiveinfo.com\/index.php?rest_route=\/wp\/v2\/posts\/1191\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/cognitiveinfo.com\/index.php?rest_route=\/"}],"wp:attachment":[{"href":"http:\/\/cognitiveinfo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/cognitiveinfo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1191"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/cognitiveinfo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}