Improving x legend

This commit is contained in:
7u83 2017-03-24 08:35:00 +01:00
parent f6cc6bbb7d
commit bcb8bb9e38
2 changed files with 13 additions and 11 deletions

View File

@ -15,8 +15,10 @@
</Menu> </Menu>
<MenuItem class="javax.swing.JCheckBoxMenuItem" name="jCheckBoxMenuItem1"> <MenuItem class="javax.swing.JCheckBoxMenuItem" name="jCheckBoxMenuItem1">
<Properties> <Properties>
<Property name="mnemonic" type="int" value="108"/>
<Property name="selected" type="boolean" value="true"/> <Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="jCheckBoxMenuItem1"/> <Property name="text" type="java.lang.String" value="Log Scale"/>
<Property name="toolTipText" type="java.lang.String" value=""/>
</Properties> </Properties>
</MenuItem> </MenuItem>
</SubComponents> </SubComponents>

View File

@ -148,7 +148,7 @@ public class Chart extends javax.swing.JPanel implements QuoteReceiver, Scrollab
class XLegendDef { class XLegendDef {
// double unit_width = 1.5; // double unit_width = 1.5;
int big_tick = 8; int big_tick = 10;
long start; long start;
XLegendDef() { XLegendDef() {
@ -191,6 +191,11 @@ public class Chart extends javax.swing.JPanel implements QuoteReceiver, Scrollab
int n; int n;
double x; double x;
System.out.printf("ClipBounds w: %d\n",clip_bounds.width);
for (n = 0, x = 0; x < dim.width; x += em_size * x_unit_width) { for (n = 0, x = 0; x < dim.width; x += em_size * x_unit_width) {
if (n % xld.big_tick == 0) { if (n % xld.big_tick == 0) {
@ -208,14 +213,7 @@ public class Chart extends javax.swing.JPanel implements QuoteReceiver, Scrollab
g.drawString(text, (int) x - swidth / 2, y + em_height * 2); g.drawString(text, (int) x - swidth / 2, y + em_height * 2);
} }
OHLCDataItem d; n+=1;
try {
d = data.data.get(n);
} catch (Exception e) {
d = null;
}
n++;
} }
} }
@ -571,8 +569,10 @@ public class Chart extends javax.swing.JPanel implements QuoteReceiver, Scrollab
compMenu.setText("Compression"); compMenu.setText("Compression");
ctxMenu.add(compMenu); ctxMenu.add(compMenu);
jCheckBoxMenuItem1.setMnemonic('l');
jCheckBoxMenuItem1.setSelected(true); jCheckBoxMenuItem1.setSelected(true);
jCheckBoxMenuItem1.setText("jCheckBoxMenuItem1"); jCheckBoxMenuItem1.setText("Log Scale");
jCheckBoxMenuItem1.setToolTipText("");
ctxMenu.add(jCheckBoxMenuItem1); ctxMenu.add(jCheckBoxMenuItem1);
setBackground(java.awt.Color.white); setBackground(java.awt.Color.white);