How to remove column number from p:barChart - primefaces

I am using primefaces p:barChart which is a part of the jqplot api.
I want to remove the column number (the lest number 1 ) from the jqplot-highlighter-tooltip()
I assume the answer is in one of the options in the following
http://www.jqplot.com/docs/files/jqPlotOptions-txt.html but I didn't find the correct one
Can someone can please point me to the relevant attr ?
Thanks

function ext() {
this.cfg.highlighter = {
tooltipAxes: 'y'
};
}

Related

Increment number along with a date on Google Sheets

I would like to increment a cell in a column by 1 to 999. The thing is, it contains both a number and a date:
Item 1
001/2022
002/2022
003/2022
...
999/2022
Is there a way to do this? I assume it's possible to "hard code" the date as a string "2022" and increment the value beside it but, would it be possible to maintain the date format? If anyone can provide both answers and how to tackle them in each way, I'd be much obliged. Sorry if there is a reference to something like that, I just can't find it. I'm fairly new to this.
Place this in any cell with at least 998 open cells below it:
=ArrayFormula(TEXT(SEQUENCE(999),"000")&"/2022")
You could split the string by "/", parse & increment the left value and then rejoin the two parts like so:
function testIncrement() {
console.log(increment("005/2021"));
}
function increment(cellValue) {
const DIVIDER = "/";
let [a, b] = cellValue.split(DIVIDER)
return `${Utilities.formatString("%03d", parseInt(a) + 1)}${DIVIDER}${b}`;
}

How to get pure data out of immutablejs list

So I have a List and I am able to filter to find on it which works fine for reducing the list to what I am looking for.
However, let's say I just want to get back an array of numbers, not a List, back from my search, something like:
var found = campaignTimelineBoardTemplatesModels.map((campaignTime) => {
if (campaignTime.getId() == num)
return Math.random();
});
The problem is that found is now still a List, and 2, is that I have a undefined members in this List as it seems to hold the same size as my original List.
So Map didn't do it.
All I am trying to do is get back a simple list of pure numbers that match a condition back as a pure array.
Is it possible?
Thanks,
Sean
found it, magic of reduce:
var IDs = campaignTimelineBoardTemplatesModels.reduce((result,campaignTimelineBoardTemplatesModel: CampaignTimelineBoardTemplatesModel)=>{
if (campaignTimelineBoardTemplatesModel.getCampaignTimelineId() == i_campaign_timeline_id)
result.push(campaignTimelineBoardTemplatesModel.getCampaignTimelineId());
return result;
},[])

FB 4.6 - list component -- prepend labels with an item count?

I have a list component that uses a sqlite database as the dataProvider and am able to use labelField to show the data labels just fine... I want to, however, affix an incremental count before the label field so its listed as
1.) item number 1
2.) item number 2 ... etc...
I discovered labelFunct and wrote the following to test it out:
private function lblFunct(value:Object):String
{
return value.id + ") " + value.question;
}
and that shows the automatically assigned database ID before the label text just fine.... my goal is to try to get a COUNT of each item though... I can get the LENGTH of the data provider with
myListComponentID.dataProvider.length
but cant find any info on how to achieve an incremental count. is it possible to construct some sort of for each loop in the labelFunct? can anyone shed any light on this? Thanks in advance.
You're on the right track with the labelFunction. You can use getItemIndex method on your dataProvider to determine the itemIndex of the displayed item:
private function lblFunct(value:Object):String
{
return myListComponentID.dataProvider.getItemIndex(value) + ") " + value.question;
}
with help from the person who responded, I found my way to the solution... the fabel funct ended up looking like this:
private function lblFunct(value:Object):String
{
return (myListComponentID.dataProvider.getItemIndex(value)+1) + ") " + value.question;
}
I added the +1 to compensate for the fact that its zero based. thanks to the responder though, you helped me find my way to the answer. Much appreciated!

Creating a user generated list in flash

I'm trying to create a flash application that will keep track of user generated values. The app should basically allow the user to input the name of the item and it's cost. The total costs should then be added up to show a total value to the user. I can probably figure out how to add the values together, but I'm not really sure how to allow the user to create a list and then allow the user to save it. Can anyone point me towards a tutorial or point me in the right direction?
I am using variables to add user inputed numbers to come up with a total. The first problem is that actionscript 3.0 does not allow variables for texts. I just converted it to 2.0 to fix this. The second problem, is when I test the app and put in my values and click submit, I get NaN in the total values field. Is there a reason why it wouldn't add the values?
Here is the code I used for the submit button:
on (release) {
total = Number(rent) + Number(food) + Number(travel) + Number(entertainment) + Number(bills);
}
Am I missing anything?
Can I give the input text instance names and then give them variables? How are some ways to go about this?
Thanks for the help!
Have an object array, say for example
var stack:Array = new Array();
Then push the item name and it's cost to that array when user inputs, like
stack.push({item:AAA, cost:xx});
So that you can generate the list whenever you want with that array.
You have to see how this works in code. A list in actionscript could be stored inside an array, vector, dictionary or even an Object.
Var myList:Array = [];
myList.push({name: "item 1", cost: 5 });
myList.push({name: "item 2", cost: 7.5 });
If you want to grab the 'product' of "item 1" from the list, you have to create a function for that, lets call it getProductByName
function getProductByName(name:String):Object
{
for each(var product:Object in myList)
{
if (product.name === name) return product;
}
return null; // no match found
}
You can call that function like this:
var product = getProductByName("item 1");
trace(product.cost); // 5
And you can alter the product, so lets make it more expensive
product.cost += 1;
trace(product.cost); // 6
Have fun! If you are using classes, you would create one for the product, with public name and cost, and in that case you'de better use a vector, to ensure working with the right type.
This is what fixed the issue for me in action script 3.0:
myButton.addEventListener(MouseEvent.CLICK, addThem);
function addThem(e:MouseEvent)
{
totalField.text = String ( Number(field1.text) + Number(field2.text) + ....);
}
I also had to name the instances appropriately.

AdvancedDataGrid: dataTip = headerText

I have a pretty straightforward question which google fails to give me the answer to :
I have an AdvancedDataGrid where i build the columns dynamically (variable number of columns) in ActionScript, and i want the dataTip to display the column headerText when the user hovers over a cell. Adobe's example dataTipFunction:
private function tipFunc(value:Object):String
{
if (value is AdvancedDataGridColumn)
return "Column Name";
// Use the 'name' property of the data provider element.
return "Name: " + value["name"];
}
But in this case the value is only an AdvancedDataGrid column if the user hovers over a column header? I want the dataTip to always show the headerText for that column. So if i have to use this function, then how do i get the column headerText for a cell?
And as i understand the dataTipField i can't really use it to statically equal column.headerText (dataTipField = headerText).
Anyone have any pointers on how i can achieve this? It seems like a really easy task, still i can't seem to find out how :)
You can use a different function per column, which could be anonymous:
<AdvancedDataGridColumn dataTipFunction="{function(value:Object):String{return 'Data Tip'}}" ... />