MpChartLib in Android - hide text in small slices of PieChart - pie-chart

How can i hide text of small slices in pie chart without to remove the text from the legend in the bottom?
I tried to remove the text like this:
if ((yVal < 5F) {
name = "";
} else {
//Add to y values
}
But then the legent text is empty also. so the users can't really know who is this slice.

My solution is to separate the legend texts and the pie chart slices text.
I set the legend (bottom map for each color) text and colors in this way
- In loop for all the contacts:
List<Integer> colors = new ArrayList<>();
List<String> labels = new ArrayList<>();
labels.add(fullName);
colors.add(METRIC_COLORS[index]);
Legend l = chart.getLegend();
l.setCustom(colors, labels);
In addition I added the text of pie-slices:
PieDataSet dataSet = new PieDataSet(yVals1, "");
dataSet.setColors(METRIC_COLORS);

I have a situation like this:
for (PieEntry pieEntry : leastPieEntries){
if(pieEntry.getValue() < 10)
{
pieEntry.setLabel("");
}
}
Tried to loop through all PieEntries but getValue returns the float value instead of percentage value...how did you do it?

Related

Hi I want to display a positive negative value graph in apex chart , I want 2 individual color like green for positive and red for negative

How to display 2 bar color, attached the image.
I tried giving a loop then if the condition inside the loop but only for the first value is the color set not for the remaining values (apex chart).
colors: [function() {
for (var i in chartdata ) {
if(chartdata[i]>1){
console.log("positive")
// setPostiveColor("#0000FF")
return '#7E36AF'
} else if(chartdata[i]<0){
console.log("negative",chartdata[i])
return '#D9534F'
}
}

Google Visualization Table Column Width and Row Height

I have a panel on my site that has a Google Visualization Chart (Table) with controls and custom style. I have trouble with setting column width - somehow no solution works. Where is my mistake?
My two solutions:
a) like in row 57/58 in the code:
data.setProperty(0, 0, 'style', 'width:150px;');
b) like line 134-145 in the code:
google.visualization.events.addListener(table, 'ready', function() {
google.visualization.events.addListener(table.getChart(), 'sort', setWidth);
setWidth();
});
function setWidth() {
var title = 'Field4';
var width = '500px';
$('.google-visualization-table-th:contains(' + title + ')').css('width', width);
}
Also I didn't find any solution for limiting row height. If you select one row (eg. with Field4 filter) then this one row will fill all the space. Is there a way to limit row size to the content only?
This is my code: https://jsfiddle.net/my7p01e8/2/

SSRS: Custom colors for the Category axis of a stacked bar chart

I have a stacked bar chart that only ever has 5 categories(but the value of the categories change from year to year, it is a sliding 5 year window).
I have successful customised the bars to the colors I want.
But now I wish to make the label of each Category the same color as the customised bar color.
Is there a way to do this?
You can use custom code for this.
In Report Properties | Code, you can paste in the following code:
Private colourPalette As String() = {"#418CF0", "#FCB441", "#DF3A02", "#056492", "#BFBFBF", "#1A3B69", "#FFE382", "#129CDD", "#CA6B4B", "#005CDB", "#F3D288", "#506381", "#F1B9A8", "#E0830A", "#7893BE"}
Private count As Integer = 0
Private mapping As New System.Collections.Hashtable()
Public Function GetColour(ByVal groupingValue As String) As String
If mapping.ContainsKey(groupingValue) Then
Return mapping(groupingValue)
End If
Dim c As String = colourPalette(count Mod colourPalette.Length)
count = count + 1
mapping.Add(groupingValue, c)
Return c
End Function
This will give you the option of the pastel colour palette. If you want other colours, simply replace the hex colour codes with values of your choice.
To use this, simply use the following expression:
=Code.GetColour(Fields!Thingy.Value)
Use this on your series and your label fill expressions. This will ensure that the same colour appears for both. If you have multiple graphs with the same values in, this will also ensure that the same data series across multiple graphs always have the same colour.

How to determine column width in word by openxml

I need create a word file and insert a grid in it by openxml.
So far, I know create grid like below will set the table width fit to window
TableProperties tblProps = new TableProperties();
tableWidth = new TableWidth() { Width = "5000", Type =TableWidthUnitValues.Pct };
TableStyle tableStyle = new TableStyle() { Val = "TableGrid" };
tblProps.Append(tableStyle, tableWidth);
table.Append(tblProps);
But how can I divide a row into some columns whose share same width. Because I don't know the width of the table, so I can't calculate the width of the columns.
And the column number in different row may be different.
Please help me, thanks

how to set the border color in pdf using itextsharp

I want to change the border bottom color for the tr tag in html table, which convert the pdf using Itextsharp. it is not working properly. By default black color is coming up as a result. Can any one suggest me how to achieve this uanig Itextsharp.
Thanks in Advance.
Kalai.
Try this out.
StyleSheet style = new StyleSheet();
style.LoadTagStyle("tr", "border-bottom-color", "Yellow");
objects = HTMLWorker.ParseToList(new StringReader("YOUR HTML"), style);
for (int k = 0; k < objects.Count; ++k)
{
document.AddElement((IElement)objects[k]);
}