Formatted Data Labels in CFCHART
Is there a way to format data values in CFCHART?
All my values in database are stored as 99.9 See below). These are percentages that I need to display on a bar chart. Everything works fine except when displaying 76.0, it shows as 76. All other values that have a number besides zero after the decimal point show up fine except for zero. I want the numbers to be consistent. I am already using custom XML file for formatting but unable to display the "zero" after the decimal point.
Let's assume, StartYear = 2007 and EndYear = 2008, and the data in Influencer_Data table looks like this:
ID Poll_Year Company Influence_ID Pulse Goal
96 2008 XYZ 842 59.6 59.6
97 2008 XYZ 839 80.8 80.8
98 2008 XYZ 838 86.9 86.9
99 2008 XYZ 841 67.1 67.1
100 2008 XYZ 840 66.3 66.3
101 2008 XYZ 470 54.5 54.5
102 2007 XYZ 842 56.5 56.5
103 2007 XYZ 839 81.5 81.5
104 2007 XYZ 838 85.5 85.5
105 2007 XYZ 841 71.2 71.2
106 2007 XYZ 840 76.0 76.0
107 2007 XYZ 470 54.2 54.2
108 2008 XYZ 843 82.6 82.6
And the data in influencers table looks like this:
Influencer_ID Influencer_Type
470 Regulators
838 Financial Community
839 Community Leaders
840 Media
841 Government
842 Advocates
843 Mexico
<cfloop index="i" from="#StartYear#" to="#EndYear#" step="1">
<CFQUERY NAME="GetInfluenceData#i#" DATASOURCE="#RMIDSN#">
Select ID.*, I.Influencer_Type
From Influencer_Data ID
INNER JOIN Influencers I ON ID.Influencer_ID = I.Influencer_ID
Where ID.Poll_Year = <cfqueryparam value="#i#" cfsqltype="CF_SQL_INTEGER">
AND ID.Company = 'XYZ'
Order By I.Influencer_Type
</CFQUERY>
</cfloop>
The custom XML file (TLRIS.xml) looks like this:
?xml version="1.0" encoding="UTF-8"?>
<frameChart isInterpolated="false">
<frame xDepth="4" yDepth="5" outline="black" isVGridVisible="true"/>
<xAxis>
<labelFormat pattern="#0.0"/>
</xAxis>
<yAxis>
<labelFormat pattern="#0.0"/>
<labelStyle orientation="Horizontal"/>
</yAxis>
<dataLabels style="Value" font="Arial-12" isMultiline="true">
<![CDATA[ $(value) ]]>
</dataLabels>
<legend allowSpan="true" equalCols="false" isMultiline="true"/>
<elements drawOutline="false">
<morph morph="Grow"/>
</elements>
<popup decoration="Round"/>
<paint palette="Fiesta" paint="Plain" isVertical="true" min="47" max="83"/>
<insets right="5"/>
</frameChart>
And the code for the graph is below:
<cfoutput>
<cfchart format="#ChartType#"
chartheight="300"
chartwidth="750"
scalefrom="0"
scaleto="100"
foregroundcolor="##000000"
databackgroundcolor="##ffffff"
font="Arial"
fontsize="10"
labelformat="number"
style="TLRIS.xml"
show3d="yes"
showlegend="yes"
tipstyle="mouseOver"
tipbgcolor="##FFFF00">
<cfloop index="i" from="#StartYear#" to="#EndYear#" step="1">
<cfset LoopCount = LoopCount + 1>
<cfset WhichColor = ListGetAt(colorlist, LoopCount)>
<cfchartseries
type="bar"
serieslabel="#i#"
seriescolor="#WhichColor#"
datalabelstyle="pattern">
<cfloop query="GetInfluenceData#i#">
<cfchartdata item="#Influencer_Type#" value="#Pulse#">
</cfloop>
</cfchartseries>
</cfloop>
</cfchart>
</cfoutput>
mohadi wrote:
I have already done that with no success.
I am beginning to believe this may be a bug.
Even if you try something as simple as the following, the decimal points that have zeroes don't show
<cfchart style="beige">
<cfchartseries type="pie">
<cfchartdata item="New car sales" value="50.0">
<cfchartdata item="Used car sales" value="55.0">
<cfchartdata item="Leasing" value="56.5">
<cfchartdata item="Service" value="76.2">
</cfchartseries>
</cfchart>
Well that is the wrong kind of chart and it is not using the xml style. But it works perfectly with a bar chart, using a custom style. The values display exactly as you have them above.
<cfchart style="myPatternStyle.xml">
<cfchartseries type="bar">
<cfchartdata item="New car sales" value="50.0">
<cfchartdata item="Used car sales" value="55.0">
<cfchartdata item="Leasing" value="56.5">
<cfchartdata item="Service" value="76.2">
</cfchartseries>
</cfchart>
<!--- snippet from xml styles --->
.... other xml ....
<yAxis scaleMin="0">
<titleStyle font="Arial-12-bold"/>
<dateTimeStyle majorUnit="Year" minorUnit="Month"/>
<labelFormat style="Pattern" pattern="#,##0.0#######"/>
</yAxis>
.... other xml ....
Similar Messages
-
Problem formatting date labels with DateTimeAxis and parseFunction
I'm working with a line chart that gets its data from a MySQL
database and
I'm using a DateTimeAxis to try to display the date on the
x-axis. The date
is formatted in the database as "YYYY-MM-DD" - however when I
run the
application I am only seeing the date displayed as MM/YY. I
am using a
parseFunction as follows:
public function myParseFunction(s:String):Date {
var a:Array = s.split("-");
var newDate:Date = new Date(a[0],a[1]-1,a[2]);
return newDate;
I was trying to experiment with setting dataUnits to days or
weeks but it
doesn't seem to change. Can anyone figure out what I'm doing
wrong?
Thanks,
-Dan
The code for the line chart is:
<mx:LineChart x="10" id="linechartHist"
dataProvider="{dataProvider1}"
showDataTips="true" width="100%" height="100%" y="10">
<mx:horizontalAxis>
<mx:DateTimeAxis displayName="Date" title="Date (Month)"
parseFunction="myParseFunction" dataUnits="days"/>
</mx:horizontalAxis>
<mx:horizontalAxisRenderer>
<mx:AxisRenderer canDropLabels="true"/>
</mx:horizontalAxisRenderer>
<mx:verticalAxis>
<mx:LinearAxis title="Price" id="vAxis"
labelFunction="vLongLabels"
interval="10"/>
</mx:verticalAxis>
<mx:series>
<mx:LineSeries displayName="MSFT" yField="MSFT"
xField="date"/>
<mx:LineSeries displayName="PG" yField="PG"
xField="date"/>
<mx:LineSeries displayName="NTDOY" yField="NTDOY"
xField="date"/>
</mx:series>
</mx:LineChart>Hi
Try using "sv_SE" locale. -
Format % in chart label when Data Label Option is 'Show Series and % value'
I am using:
OracleBI Discoverer 10g (10.1.2.2)
Oracle Business Intelligence Discoverer Plus 10g (10.1.2.54.25)
I have a report that returns 2 columns 'Repair Status' and 'Count' The graph is a pie chart and I have selected the Data Label Option as 'Series Label and % value'. The percents displayed in the label have no consistent format. Sometimes 2 decimal places, sometimes 4 decimal places. I want the chart label to consistently display the % in the chart label with no decimal, i.e. 96%. How can I accomplish this?Hi,
Where you selected 'Select Label and % Value', there is a button at the bottom, Format Data Labels. In there, there is a Number tab where you can play around by selecting Currency, Percent, etc. Have you tried this?
Cheers.
Mahesh -
Can not edit data labels in old graph chart objects using Word 2010
In Word 2010, Insert object "Microsoft Graph Chart", go to Chart Options and check an item in Data labels, such as "Series Name", "Category Name" or "Value". Click OK, then double-click on a data label to edit its
settings, or right-click on a data label and select "Format Data Labels..."
This makes Word to crash. The only way I can get out of it is by using the Task Manager to kill Word.
This happens in Windows 7 and Windows 8. This does NOT not happen in Word 2007 nor Word 2013, so it seems specific to Word 2010. All our clients have the same problem, this does not seem related to a specific workstation configuration.
The Microsoft Graph Chart are the old charts used within .doc files. I have an application still generating those types of files and need to edit data label settings manually before processing the files with my application.
Also note that anytime you edit a .doc file in Word 2010 and you see "Compatibility Mode" in the title bar, the Insert / Chart option from the ribbon inserts an old type chart (same as if you use Insert / Object / Microsoft Graph Chart), not the
new Word 2010 charts. You then have the same problem editing the data labels.
The underlying Activex seems to be the Chart.Exe file, the one I have installed is 14.0.7012.1000. You can see the version by double-clicking the chart and then look in the Help / About menu.
Any help will be greatly appreciated.As this is a configuration issue and not a programming issue I' moving your question to a more appropriate forum where you're more likely to find assistance.
Cindy Meister, VSTO/Word MVP,
my blog -
Formatting bar chart data label
Post Author: dkekesi
CA Forum: General
Hi All,I have a chart that contains how long it took to perform a certain task for each user (user name is on the X axis, times on the Y axis). The problem is that the data is displayed in seconds. I wish to format the data label on the bars so they show 00:45:42 (in hh:mm:ss format) instead of 2742 seconds, for example.I have not found a way to do this. Is there a way at all?Thanks for the help. DanielPost Author: V361
CA Forum: General
I have CR XI, not sure if this is supported in earlier versions. You can create a formula, and use the formula in the graph. For example:
Numbervar Totalsec := Sum ({@Login Hrs secs}, );
NumberVar Days :=(Truncate (TotalSec / 86400)*24);
NumberVar Hours :=(Truncate (Remainder (TotalSec,86400) / 3600))+ Days;
NumberVar Minutes :=Truncate (Remainder (TotalSec,3600) / 60);
NumberVar Seconds :=Remainder (TotalSec,60);
Hours & ":" & Minutes & ":" & Seconds
The addition of *24 in the NumberVar Days sum combined with the addition of days to the NumberVar hours gives a total time in hours no matter whether in excess of 24 hours or not.
Use this formula in your chart. instead of your seconds field. -
Data label formatting for SVG charts seems to have a bug in 1.6.
Could you take a look at
http://htmldb.oracle.com/pls/otn/f?p=20794:1
The first chart does not have a format mask and the chart works correctly. The 2nd chart is an exact copy of the first chart, but has a Data Label Format mask. I have tried several different format masks and they all cause the chart to only display one bar.
By the way, this worked correctly in 1.4. I discovered it on moving an application to 1.6.
ThanksDoyle,
you can work around the problem by getting rid of the data format in the page definition and applying your own formatting using the TO_CHAR function.
You could even make it dynamic by storing the data format in a page item, picking it from a static LOV for instance.
That would allow a user to choose the preferred one.
If you don't want to give the user this flexibility, then you can store the mask in a hidden item, so that you can make the feature available at a later stage of development.
Bye,
Flavio -
Miss data label when desktopintelligence report saved as excel
BO version is XIR2 Sp2.
create a column chart with 2 measures in deski.
show data labels for these 2 columns, it is ok in deski.
but when save the report as excel format, found data label only shown on first column, and miss the label for another column.
Is it a bug in bo?
please advise, thanksHi Zhang,
The issue you are getting is fixed in SP3 similar issues were reported as bug previously.
Following are the details could you please test the issue on SP3 under test environment.
ADAPT00785260 Value of labels on line chart doesn't show when report is saved in excel and chart contains an additional group.
ADAPT00864551 - Axis Label is missing when you do save as xls for the Deski Reports with charts.
Regards,
Sarbhjeet Kaur -
Need to change individual data label colors
I have a percent bar chart that reads all from one column. This seems like it should be simple for crystal reports to do but I can't find it anywhere. I need to be able to change the color of the individual percentage data labels that show up. When I click on the data label and go to change the color it changes the color for all data labels in the chart, not just the data label for that series.
hello,
unfortunately there is no conditional formatting on data labels...they will always be one colour.
however, if you know that there will always be the same number of bars in your chart and you have a bit of time for a workaround you can always place a cross-tab on top of the chart...see the attached. you can dynamically colour the labels, backgrounds, etc. as this is a cross-tab but you can't change the positioning of the label.
jamie -
How to display the Data labels in Chartobject Dynamically?
Hi
i am using Crystal Report Server XI R2 - ReportClientDocument to generate reports dynamically.
i want to display the data labels on the chart object in runtime. how it is possible?
is there any way to achieve this? since it is possible in designer, i hope that there must be WAY.....
Regards,
Padmanaban VThe chart analyzer is a third party tool that Crystal is licensed to use in the designer. That means in the Crystal Designer you have a lot of chart functionality, but at runtime the chart exists as part of the report object and the analyzer is not present. Therefore you have a few formatting options but not as many as in the designer.
For details of what options you have with the chart at runtime, see these links:
[1|http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/en/CrystalReports_dotNET_SDK/crsdk_net_doc/doc/crsdk_net_doc/html/crlrfCrystalDecisionsCrystalReportsEngineChartObject_MembersTopic.htm]
[2|http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/en/CrystalReports_dotNET_SDK/crsdk_net_doc/doc/crsdk_net_doc/html/crlrfCrystalDecisionsCrystalReportsEngineChartObject_PropertiesTopic.htm]
[3|http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/en/CrystalReports_dotNET_SDK/crsdk_net_doc/doc/crsdk_net_doc/html/crlrfCrystalDecisionsCrystalReportsEngineChartObjectClassTopic.htm]
Ludek -
Can't show data labels in pie graphs as decimal number if the crosstab data
I want to show my data labels in diagrams, as percent values, with three decimals.
It occurs (in version Oracle Business Intelligence Discoverer Plus 10g (10.1.2.55.26)) it is only possible if the data format of the crosstab data also shows data with decimals. If the data are in integer format, the graphs data labels can only be shown in integer as well.
Does anyone know how to fix the problem?
In version Oracle Business Intelligence Discoverer Plus 10g (10.1.2.48.18) we can have a crosstab showing integers and a pie graph showing labels of pie slices where the labels are in percent with three decimals. It seems it does not work in the newer version Oracle Business Intelligence Discoverer Plus 10g (10.1.2.55.26)
Thanks in advanceIt seems I have another similar problem in version Oracle Business Intelligence Discoverer Plus 10g (10.1.2.55.26):
I have a Bar (Percent) graph based on a crosstab where the data is formatted as number with two decimals.
The labels in the graph shows as number (0,76 instead of 76% and 0,13 instead of 13%). I want them to be shown in percent format.
The Data Label format is set to “Number” with two decimals. I can change the Data Labels to Percent with two decimals and then it shows the data labels in the graph exactly as I want it. But after I have saved the workbook and then opened it again the changes has been “revoked” and is once again set to number with two decimals instead of percent.
thanks (again) in advance -
Stacked Column Chart Data Labels Not Appearing
I am using SetSytle in Actionscript to make the data labels in a stacked column chart appear inside but it's not working.
A portion of the code I am using to create the chart is below:
//initialize column set for stacked columns
var colSet:ColumnSet = new ColumnSet();
colSet.type="stacked";
for each(var node:XML in _chartDP){
var k:int = 0;
//skip zero datapoints
if (parseInt(node.toString()) != 0) {
//if measure node does not exist, add as series
k = uniqueYCat(node.attribute("BillTo"));
if (k == -1){
// Create the new column series and set its properties.
var localSeries:ColumnSeries = new ColumnSeries();
localSeries.setStyle("labelPosition","inside");
localSeries.dataProvider = dataArray;
localSeries.yField = node.attribute("BillTo");
localSeries.xField = "ConfidenceStatus";
localSeries.displayName = node.attribute("BillTo");
localSeries.setStyle("showDataEffect", ChangeEffect);
// Back up the current series on the chart.
var currentSeries:Array = chart.series;
// Add the new series to the current Array of series.
currentSeries.push(localSeries);
//Add Array of series to columnset
colSet.series.push(localSeries);
//assign columnset to chart
chart.series = [colSet];
After some more research, I put a breakpoint inside ColumnChart.as in the following function:
mx_internal function getSeriesLabelPos(series:Series):void
if(series is ColumnSeries)
var columnSeries:ColumnSeries = ColumnSeries(series);
var position:String = columnSeries.labelPos;
if(position == "inside" || position == "outside" || position == "none")
_needLabels = true;
else if(series is ColumnSet)
var setSeries:Array /* of Series */ = ColumnSet(series).series;
for (var i:int = 0; i < setSeries.length; i++)
getSeriesLabelPos(setSeries[i]);
the following line: var position:String = columnSeries.labelPos;
returns postion as null. It looks like the setStyle is not passing the correct value to this function.
Any ideas as to what is going on?chart appearance is controlled by xml files located in
{cfroot}\charting\styles. the file for bar charts is
default.xml
you will want to:
1) copy thisfile to your site's root or some other folder
(i.e. same
folder that the page displaying your chart is in)
2) edit the file and change isHideOverlapped attribute of
labelStyle
property for xAxis to "false"
3) point the STYLE attribute of your cfchart tag to this new
file.
hth
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/ -
BIP 11.1.1.7 - Stacked Bar chart data label not visible in pdf
Hi all,
I have a report built with the online editor. This contains a stacked bar chart with percentage values in a repeating section and I made the property DataVisible=true.
When I view the report in interactive mode it all works: I can see the data label for every value of the parameter but when I view in any other format (PDF, PPT, ecc..) the data labels are visible in the first chart (for the first value of the parameter) while in the other charts they aren't. This doesn't happens for other types of chart, for example with a pie chart.
Can someone help me or tell if it is a bug?
Thanks,
MicaelaHi Mitalee,
Would you please check the PAM at https://websmp108.sap-ag.de/~sapidb/012002523100018972812014E
On page 11 it says 64 bit IE11 is not supported; is your IE11 32 bit or 64 bit? -
Unable to change Data label position in the Chart using Position from Properties
Hi All,
I am trying add the Data label to the chart and the users want them to appear on the top of the stacked bars. By default when I enabled the data labels it showed up in the middle. When I tried to change the position by doing
View --> Properties --> Position --> Top/Bottom/any of other 8 options -- it does move a bit
I even tried deleting chart and recreating it.
What am I missing? Thanks in advance.Hi Ranjith_SQL,
According to your description that you have add the Data label on your stacked column chart which by default display in the middle of the chart, you want them to appear on the top of the stacked column chart, right?
For a Stacked Column Chart, the data labels are always placed in the center of the Series bars. This is by design. I also test it on my new version of SSRS 2014 and find have the same result.
If you really need the data label to display on the top, I recommend you to change the chart type to column chart which by default have the Data labels display at the top of the column:
You can also submit an wish at
https://connect.microsoft.com/SQLServer/
If the suggestion mentioned by customers for many times, the product team may consider to add the feature in the next SQL Server version. Your feedback is valuable for us to improve our products and increase the level of service provided.
Thanks for your understanding.
Regards
Vicky Liu -
Adding data labels to column graph
I work in the financial industry and I have to add data labels to all bars that appear in my ten year performance graphs (see http://fundinvestor.calamos.com/ClosedEndFunds/CEFund.aspx?name=CHI under the "Performance" tab as an example). Is there a script that can do this? I saw there's this technique that Adobe offers for column totals: http://livedocs.adobe.com/en_US/Illustrator/13.0/help.html?content=WS714a382cdf7d304e7e07d 0100196cbc5f-619e.html but that's not working. What am I doing wrong? Adding data labels to bars is ridiculously simple in Excel, why can't I find the way to do it easily in Illustrator?
http://help.adobe.com/en_US/Illustrator/14.0/WS714a382cdf7d304e7e07d0100196cbc5f-619ea.htm l
That should do the trick.
Mylenium -
How to print formated data/report on client's printer (Web Application)
Hi All
I want to print some formatted data/report ( it might be 1000 pages) on user's printer.
Application is web based
Technology used are Java - jsp - servlets
i want functionality like...
when user click on print button/link, data is fetched from server and all pages (it is formated data so i want alignment on page while printing) should be printed one after another.
Also printer selection dialog should displayed one time when user click on print button/link.
Questions:
1. How i will transfer all data to client (web browser) from the server ??
2. And how i can print that data on user's printer ??
There is requirement (or limitation) that I can not use applet for this purpose.
And also it is not fix that we must use java tech., we can use any othere tech. but condition is that it must support multiple platform (in short platform indipendant)
There is solution like ...
I can use window.print() function of DOM/JavaScript,
but it prints only one page which is displayed on browser.
I don't want to display any page. and want to print all pages.
if any one done or have idea then let me know.
Thanks in Adv.
Shailesh Koradiyathanks linxpda for reply,
we can use ActiveX component for windows platform for printing purpose, same way we can use platform specific component for printing... (for linux, unix, sun solaris etc...)
if it is possible then let me inform.
Thanks,
Shailesh Koradiya
Maybe you are looking for
-
I have tried adjusting the code and stripping it down, but nothing seems to work. When I preview the website in Internet Explorer, it works just fine.
-
Operations Manager 2012 R2 Unix/Linux agents installation
Hi! I want to monitor some Linux (RH6) servers with Operations manager 2012 R2. I successfully imported necessary management packs- and then I'm lost. I cannot discover Linux clients from console. And I can't find good guidance how to deploy and mana
-
Output SELECT statement to CSV file
Can someone advise the best approach please I'm trying to create a CSV file from the output of a SELECT statement in ApEx as a PL/SQL block. I initially thought the simplest approach would be to use SPOOL and then execute the SELECT startment but I t
-
Name of database connected to this application server
dears , i have Oracle Application Server 10g (10.1.2.0.2) i want to get database UNIQUE_name that is connect to this application server !!! i run this command SELECT sys_context('USERENV', 'DB_UNIQUE_NAME') FROM dual; it gave me name of application s
-
Hi I'm using Acrobat V7 in Windows. I've created a text document in word which is lengthy, converted it to pdf and now want to save each page as a pdf file. When I use the snapshot tool I lose resolution or quality. Is there a way that I can change t