[flexcoders] Re: Resetting Chart scale on LineAxis

2012-07-11 Thread k.sigiscar
Hi Claudiu,

Here is part of the existing code of the custom component.

Data is invalidated in the dataProvider setter and used in commitProperties:


override protected function commitProperties():void
{
super.commitProperties();


if(isTextColorStyleChanged)
{
isTextColorStyleChanged = false;

pricesAreaChart.setStyle(color, 
textColorData);
pricesHLOCChart.setStyle(color, 
textColorData);
tradeVolumesChart.setStyle(color, 
textColorData);
legend.setStyle(color, textColorData);
}

if(isFontFamilyStyleChanged)
{
isFontFamilyStyleChanged = false;

pricesAreaChart.setStyle(fontFamily, 
fontFamilyData);
pricesHLOCChart.setStyle(fontFamily, 
fontFamilyData);
tradeVolumesChart.setStyle(fontFamily, 
fontFamilyData);
legend.setStyle(fontFamily, fontFamilyData);
}

if(isFontWeightStyleChanged)
{
isFontWeightStyleChanged = false;

pricesAreaChart.setStyle(fontWeight, 
fontWeightData);
pricesHLOCChart.setStyle(fontWeight, 
fontWeightData);
tradeVolumesChart.setStyle(fontWeight, 
fontWeightData);
legend.setStyle(fontWeight, fontWeightData);
}

if(isFontSizeStyleChanged)
{
isFontSizeStyleChanged = false;

pricesAreaChart.setStyle(fontSize, 
fontSizeData);
pricesHLOCChart.setStyle(fontSize, 
fontSizeData);
tradeVolumesChart.setStyle(fontSize, 
fontSizeData);
legend.setStyle(fontSize, fontSizeData);
}

if(this._bDataDirty)
{
this._bDataDirty = false;   

// Update the time line start and end time

timeLine.startTime = minTime;
timeLine.endTime = maxTime;

// Reset charts series

pricesAreaChart.series = [];
pricesHLOCChart.series = [];
tradeVolumesChart.series = [];

// Reset change watchers to prevent memory 
leaks as we do no set useWeakReference to true

for each(var changeWatcher:ChangeWatcher in 
changeWatchers)
{
changeWatcher.unwatch();
changeWatcher = null;
}

changeWatchers = [];

// Remove Dynamic skin parts

for each(var dynamicSkinPartObject:Object in 
dynamicPartsInstances) {

removeDynamicPartInstance(dynamicSkinPartObject.partName, 
dynamicSkinPartObject.instance);  
}

dynamicPartsInstances = [];

// Create charts series

var columnSet:ColumnSet = new ColumnSet();
columnSet.type = stacked;

for each(var item:StockDataItemDTO in 
dataProvider)
{
if(item.data)
{
if(item.isPrimary) {
timeLineAreaSeries.dataProvider = item.data;
}

// Create one data tip 

[flexcoders] Re: Resetting Chart scale on LineAxis

2012-07-11 Thread k.sigiscar
I have checked out the Flex JIRA and this might be the issue since I use 
ColumnSet in my chart component:
https://bugs.adobe.com/jira/browse/FLEXDMV-1674



[flexcoders] Re: Resetting Chart scale on LineAxis

2012-07-09 Thread k.sigiscar

Hi Claudiu,

Yes, I saw that one. But he's using a CategoryAxis and not a DateTimeAxis (we 
bind the minimum and maximum properties of the DateTimeAxis to the values of 
our timeline component).

Therefore, we cannot do the same thing as he does to reset the chart scale.

Best regards,
Karl.


--- In flexcoders@yahoogroups.com, claudiu ursica the_braniak@... wrote:

 Hi Karl,
 Can you share some basic example? I don't know how your chart and data looks 
 like, and how you add/discard new data.
 
 I see you already ran into this and did not work...
 https://userflex.wordpress.com/2011/04/21/update-linear-axis/
 
 C
 
 
 
 
  From: k.sigiscar k.sigiscar@...
 To: flexcoders@yahoogroups.com 
 Sent: Monday, July 9, 2012 10:24 AM
 Subject: [flexcoders] Resetting Chart scale on LineAxis
  
 
   
 Hi,
 
 I have a chart with dynamic series on a LinearAxis (Y) and a DateTimeAxis (X).
 
 The series visibility can be set to true / false by the user.
 
 When a series with a very high value is displayed, the rest of the chart is 
 scaled down.
 
 When the series with the high values is then discarded (visibility set to 
 false), the chart doesn't scale down again.
 
 Is there a way to force the chart to reset its scale (min/max) values ?
 
 Best regards,
 Karl Sigiscar.




Re: [flexcoders] Re: Resetting Chart scale on LineAxis

2012-07-09 Thread claudiu ursica
Hi Karl,
I am not an expert on the charts, I only played with an example from the docs 
which updates nicely. Hence the request about some 
basic example to see if it can be narrowed down. Unless you already try it, you 
can debug the bindings via the 
BindingManager.debugBinding() or wrap the min/max inside functions and add 
temporary log/checks support inside those functions 
to see if calls/updates are happenin. If it is a binding issue you are in 
luck... 

On the other hand, you may also have to byte the bullet and replace the 
bindings with hand written code. That way you get a better control of what code 
is executing...
If it is a bug in the charts than you will need to fix/monkey patch it...

Either way it helps if you can narrow it down to a simple example where you can 
add/remove data from a button. If you can have that I can also 
try to have a look at it.

HTH,
C




 From: k.sigiscar k.sigis...@yahoo.com
To: flexcoders@yahoogroups.com 
Sent: Monday, July 9, 2012 3:19 PM
Subject: [flexcoders] Re: Resetting Chart scale on LineAxis
 

  

Hi Claudiu,

Yes, I saw that one. But he's using a CategoryAxis and not a DateTimeAxis (we 
bind the minimum and maximum properties of the DateTimeAxis to the values of 
our timeline component).

Therefore, we cannot do the same thing as he does to reset the chart scale.

Best regards,
Karl.

--- In flexcoders@yahoogroups.com, claudiu ursica the_braniak@... wrote:

 Hi Karl,
 Can you share some basic example? I don't know how your chart and data looks 
 like, and how you add/discard new data.
 
 I see you already ran into this and did not work...
 https://userflex.wordpress.com/2011/04/21/update-linear-axis/
 
 C
 
 
 
 
  From: k.sigiscar k.sigiscar@...
 To: flexcoders@yahoogroups.com 
 Sent: Monday, July 9, 2012 10:24 AM
 Subject: [flexcoders] Resetting Chart scale on LineAxis
 
 
   
 Hi,
 
 I have a chart with dynamic series on a LinearAxis (Y) and a DateTimeAxis (X).
 
 The series visibility can be set to true / false by the user.
 
 When a series with a very high value is displayed, the rest of the chart is 
 scaled down.
 
 When the series with the high values is then discarded (visibility set to 
 false), the chart doesn't scale down again.
 
 Is there a way to force the chart to reset its scale (min/max) values ?
 
 Best regards,
 Karl Sigiscar.



 

[flexcoders] Re: Resetting Chart scale on LineAxis

2012-07-09 Thread k.sigiscar
Hi,

The minimum and maximum properties of the LinearAxis are not bound to anything 
and they are the ones I have problems with (values not resetting when setting 
series visibility).

Only the minimum and maximum properties of the DateTimeAxis are bound and there 
is no problem with that part.

Best regards,
Karl.


--- In flexcoders@yahoogroups.com, claudiu ursica the_braniak@... wrote:

 Hi Karl,
 I am not an expert on the charts, I only played with an example from the docs 
 which updates nicely. Hence the request about some 
 basic example to see if it can be narrowed down. Unless you already try it, 
 you can debug the bindings via the 
 BindingManager.debugBinding() or wrap the min/max inside functions and add 
 temporary log/checks support inside those functions 
 to see if calls/updates are happenin. If it is a binding issue you are in 
 luck... 
 
 On the other hand, you may also have to byte the bullet and replace the 
 bindings with hand written code. That way you get a better control of what 
 code is executing...
 If it is a bug in the charts than you will need to fix/monkey patch it...
 
 Either way it helps if you can narrow it down to a simple example where you 
 can add/remove data from a button. If you can have that I can also 
 try to have a look at it.
 
 HTH,
 C
 
 
 
 
  From: k.sigiscar k.sigiscar@...
 To: flexcoders@yahoogroups.com 
 Sent: Monday, July 9, 2012 3:19 PM
 Subject: [flexcoders] Re: Resetting Chart scale on LineAxis
  
 
   
 
 Hi Claudiu,
 
 Yes, I saw that one. But he's using a CategoryAxis and not a DateTimeAxis (we 
 bind the minimum and maximum properties of the DateTimeAxis to the values of 
 our timeline component).
 
 Therefore, we cannot do the same thing as he does to reset the chart scale.
 
 Best regards,
 Karl.
 
 --- In flexcoders@yahoogroups.com, claudiu ursica the_braniak@ wrote:
 
  Hi Karl,
  Can you share some basic example? I don't know how your chart and data 
  looks like, and how you add/discard new data.
  
  I see you already ran into this and did not work...
  https://userflex.wordpress.com/2011/04/21/update-linear-axis/
  
  C
  
  
  
  
   From: k.sigiscar k.sigiscar@
  To: flexcoders@yahoogroups.com 
  Sent: Monday, July 9, 2012 10:24 AM
  Subject: [flexcoders] Resetting Chart scale on LineAxis
  
  
    
  Hi,
  
  I have a chart with dynamic series on a LinearAxis (Y) and a DateTimeAxis 
  (X).
  
  The series visibility can be set to true / false by the user.
  
  When a series with a very high value is displayed, the rest of the chart is 
  scaled down.
  
  When the series with the high values is then discarded (visibility set to 
  false), the chart doesn't scale down again.
  
  Is there a way to force the chart to reset its scale (min/max) values ?
  
  Best regards,
  Karl Sigiscar.