flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlosrov...@apache.org
Subject [02/17] git commit: [flex-asjs] [refs/heads/feature/mdl] - Cleaned up the label positioning for the horizontal linear axis (ArrayList data). Added more CSS classNames to help styles the charts better.
Date Tue, 18 Oct 2016 22:51:45 GMT
Cleaned up the label positioning for the horizontal linear axis (ArrayList data). Added more
CSS classNames to help styles the charts better.


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/346718a9
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/346718a9
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/346718a9

Branch: refs/heads/feature/mdl
Commit: 346718a92511601ab61ea228f5a9a79eb319ba8a
Parents: a936177
Author: Peter Ent <pent@apache.org>
Authored: Tue Oct 18 15:38:46 2016 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Tue Oct 18 15:38:46 2016 -0400

----------------------------------------------------------------------
 .../flex/org/apache/flex/charts/beads/ChartView.as    |  2 ++
 .../beads/HorizontalLinearAxisForArrayListBead.as     | 14 +++++++++++++-
 .../flex/charts/supportClasses/ChartAxisGroup.as      |  2 ++
 3 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/346718a9/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/ChartView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/ChartView.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/ChartView.as
index 84860fa..dce3079 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/ChartView.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/ChartView.as
@@ -91,6 +91,7 @@ package org.apache.flex.charts.beads
 				var m1:Class = ValuesManager.valuesImpl.getValue(_strand, "iHorizontalAxisGroup");
 				_horizontalAxisGroup = new m1();
 				haxis.axisGroup = _horizontalAxisGroup;
+				UIBase(_horizontalAxisGroup).className = "HorizontalAxis";
 				IParent(_strand).addElement(_horizontalAxisGroup, false);
 			}
 			
@@ -99,6 +100,7 @@ package org.apache.flex.charts.beads
 				var m2:Class = ValuesManager.valuesImpl.getValue(_strand, "iVerticalAxisGroup");
 				_verticalAxisGroup = new m2();
 				vaxis.axisGroup = _verticalAxisGroup;
+				UIBase(_verticalAxisGroup).className = "VerticalAxis";
 				IParent(_strand).addElement(_verticalAxisGroup, false);
 			}
 			

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/346718a9/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/HorizontalLinearAxisForArrayListBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/HorizontalLinearAxisForArrayListBead.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/HorizontalLinearAxisForArrayListBead.as
index 4ade000..7749d82 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/HorizontalLinearAxisForArrayListBead.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/HorizontalLinearAxisForArrayListBead.as
@@ -18,9 +18,9 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.charts.beads
 {
-	import org.apache.flex.collections.ArrayList;
 	import org.apache.flex.charts.core.IChart;
 	import org.apache.flex.charts.core.IHorizontalAxisBead;
+	import org.apache.flex.collections.ArrayList;
 	import org.apache.flex.core.IBead;
 	import org.apache.flex.core.ISelectionModel;
 	import org.apache.flex.core.IStrand;
@@ -100,6 +100,8 @@ package org.apache.flex.charts.beads
 			
 			// place the labels below the axis enough to account for the tick marks
 			var labelY:Number = 7;
+			var lastX:Number = -1000;
+			var lastWasHidden:Boolean = false;
 			
 			for(i=0; i < numTicks+1; i++) 
 			{	
@@ -111,6 +113,16 @@ package org.apache.flex.charts.beads
 				
 				xpos += tickSpacing;
 				tickValue += tickStep;
+				
+				if ((label.x-5) <= lastX && !lastWasHidden) {
+					label.visible = false;
+					lastWasHidden = true;
+				} else {
+					label.visible = true;
+					lastWasHidden = false;
+				}
+				
+				lastX = label.x + label.width;
 			}
 			
 			// draw the axis and tick marks

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/346718a9/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ChartAxisGroup.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ChartAxisGroup.as
b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ChartAxisGroup.as
index 670130c..b8e7d12 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ChartAxisGroup.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ChartAxisGroup.as
@@ -90,6 +90,7 @@ package org.apache.flex.charts.supportClasses
 		public function drawHorizontalTickLabel( text:String, xpos:Number, ypos:Number, boxWidth:Number,
boxHeight:Number, tickFill:IFill ):Object
 		{
 			var label:Label = new Label();
+			label.className = "TickLabel";
 			label.text = text;
 			label.x = xpos - label.width/2;
 			label.y = ypos;
@@ -117,6 +118,7 @@ package org.apache.flex.charts.supportClasses
 		public function drawVerticalTickLabel( text:String, xpos:Number, ypos:Number, boxWidth:Number,
boxHeight:Number, tickFill:IFill ):Object
 		{
 			var label:Label = new Label();
+			label.className = "TickLabel";
 			label.text = text;
 			label.x = xpos;
 			label.y = ypos - label.height/2;


Mime
View raw message