Problem:
I am trying to:
make some applications transparent using compton on i3wm such that
in tabbed/ stacked mode in i3wm the underlying windows are hidden (or are not drawn).
=========================================
Example:
For example's sake, let us take the application to be zathura.
I tried the following in my compton.conf:
opacity-rule = [
"90:class_g = 'Zathura' && !_NET_WM_STATE#:32a",
"0:_NET_WM_STATE#:32a *= '_NET_WM_STATE_HIDDEN'"
]
This makes zathura transparent when it is unfocused. If zathura is focused then it will not be transparent. So zathura is hidden if it is beneath any other transparent window in tabbed/ stacked window.
Next I tried the following in compton.conf:
opacity-rule = [
"90:class_g = 'Zathura'",
"0:_NET_WM_STATE#:32a *= '_NET_WM_STATE_HIDDEN'"
]
This does make zathura transparent, but this draws zathura beneath other windows when in tabbed or stacked mode in i3wm.
I found this and tried the suggested solution. That is, I replaced "0:_NET_WM_STATE#:32a *= '_NET_WM_STATE_HIDDEN'" with
"0:_NET_WM_STATE#[0]:32a = '_NET_WM_STATE_HIDDEN'",
"0:_NET_WM_STATE#[1]:32a = '_NET_WM_STATE_HIDDEN'",
"0:_NET_WM_STATE#[2]:32a = '_NET_WM_STATE_HIDDEN'",
"0:_NET_WM_STATE#[3]:32a = '_NET_WM_STATE_HIDDEN'",
"0:_NET_WM_STATE#[4]:32a = '_NET_WM_STATE_HIDDEN'"
However this made no change. Please help.
=========================================
Config file:
My entire compton.conf is below. Remark: Some applications such as urxvt or emacs allow me to set transparency natively. Those applications behave well in tabbed/ stacked mode with the following config:
menu = { shadow = false; };
dropdown_menu = { shadow = false; };
popup_menu = { shadow = false; };
utility = { shadow = false; };
# Shadow
shadow = true;
no-dnd-shadow = true;
no-dock-shadow = true;
clear-shadow = true;
shadow-radius = 7;
shadow-offset-x = -7;
shadow-offset-y = -7;
shadow-exclude = [
"class_g = 'i3-frame'",
"class_g = 'keynav'",
"name = 'Notification'",
"class_g ?= 'Notify-osd'",
"_GTK_FRAME_EXTENTS#:c"
];
opacity-rule = [
# "90:class_g = 'Zathura'",
"90:class_g = 'Zathura' && !_NET_WM_STATE#:32a",
# "0:_NET_WM_STATE#:32a *= '_NET_WM_STATE_HIDDEN'"
"0:_NET_WM_STATE#[0]:32a *= '_NET_WM_STATE_HIDDEN'"
,"0:_NET_WM_STATE#[1]:32a *= '_NET_WM_STATE_HIDDEN'"
,"0:_NET_WM_STATE#[2]:32a *= '_NET_WM_STATE_HIDDEN'"
,"0:_NET_WM_STATE#[3]:32a *= '_NET_WM_STATE_HIDDEN'"
,"0:_NET_WM_STATE#[4]:32a *= '_NET_WM_STATE_HIDDEN'"
];
# Fading
fading = true;
fade-delta = 5;
fade-in-step = 0.03;
fade-out-step = 0.03;
fade-exclude = [ ];
# Other
backend = "xrender";
mark-wmwin-focused = true;
mark-ovredir-focused = true;
detect-rounded-corners = true;
detect-client-opacity = true;
refresh-rate = 0;
vsync = "none";
dbe = false;
focus-exclude = [ "class_g = 'Cairo-clock'" ];
detect-transient = true;
detect-client-leader = true;
invert-color-include = [ ];
# GLX backend
glx-copy-from-front = false;
glx-swap-method = "undefined";
# Window type settings
wintypes:
{
tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; };
};
Related
I've had this HighCharts spider chart working fine for a while now, but we upgraded to the latest HighCharts code and I noticed that the mouseovers are no longer working. My PHP code looks like this:
// Create a new Highchart
$chart = new Highchart();
$chart->includeExtraScripts();
$chart->chart->renderTo = "control_maturity_spider_chart";
$chart->chart->polar = true;
$chart->chart->type = "line";
$chart->chart->width = 1000;
$chart->chart->height = 1000;
$chart->title->text = "Current vs Desired Maturity by Control Family";
$chart->title->x = -80;
$chart->pane->size = "80%";
$chart->xAxis->categories = $categories;
$chart->xAxis->tickmarkPlacement = "on";
$chart->xAxis->lineWidth = 0;
$chart->yAxis->gridLineInterpolation = "polygon";
$chart->yAxis->lineWidth = 0;
$chart->yAxis->min = 0;
$chart->yAxis->max = 5;
$chart->yAxis->tickInterval = 1;
$chart->tooltip->shared = true;
$chart->tooltip->pointFormat = '<span style="color:{series.color}">{series.name}: <b>{point.y}</b><br/>';
$chart->legend->align = "center";
$chart->legend->verticalAlign = "top";
$chart->legend->layout = "vertical";
// Draw the Current Maturity series
$chart->series[0]->name = $escaper->escapeHtml($lang['CurrentControlMaturity']);
$chart->series[0]->data = empty($categories_current_maturity_average) ? [] : $categories_current_maturity_average;
$chart->series[0]->pointPlacement = "on";
// Draw the Desired Maturity series
$chart->series[1]->name = $escaper->escapeHtml($lang['DesiredControlMaturity']);
$chart->series[1]->data = empty($categories_desired_maturity_average) ? [] : $categories_desired_maturity_average;
$chart->series[1]->pointPlacement = "on";
$chart->credits->enabled = false;
echo "<figure class=\"highcharts-figure\">\n";
echo " <div id=\"control_maturity_spider_chart\"></div>\n";
echo "</figure>\n";
echo "<script type=\"text/javascript\">";
echo $chart->render("control_maturity_spider_chart");
echo "</script>\n";
The actual chart renders just fine, but if you mouse over it, you just get this message in the javascript console over and over again:
HighCharts Error Message
If we comment out these two lines of code, the mouseover works:
$chart->tooltip->shared = true;
$chart->tooltip->pointFormat = '<span style="color:{series.color}">{series.name}: <b>{point.y}</b><br/>';
Any thoughts on what we are doing wrong here, or what changed, would be greatly appreciated. Thank you.
this is the bug which you can track here: https://github.com/highcharts/highcharts/issues/17472
As a temporary workaround, add the following wrap function to your code:
(function(H) {
const isObject = H.isObject;
H.Pointer.prototype.findNearestKDPoint = function(series, shared, e) {
var chart = this.chart;
var hoverPoint = chart.hoverPoint;
var tooltip = chart.tooltip;
if (hoverPoint &&
tooltip &&
tooltip.isStickyOnContact()) {
return hoverPoint;
}
var closest;
/** #private */
function sort(p1, p2) {
var isCloserX = p1.distX - p2.distX,
isCloser = p1.dist - p2.dist,
isAbove = ((p2.series.group && p2.series.group.zIndex) -
(p1.series.group && p1.series.group.zIndex));
var result;
// We have two points which are not in the same place on xAxis
// and shared tooltip:
if (isCloserX !== 0 && shared) { // #5721
result = isCloserX;
// Points are not exactly in the same place on x/yAxis:
} else if (isCloser !== 0) {
result = isCloser;
// The same xAxis and yAxis position, sort by z-index:
} else if (isAbove !== 0) {
result = isAbove;
// The same zIndex, sort by array index:
} else {
result =
p1.series.index > p2.series.index ?
-1 :
1;
}
return result;
}
series.forEach(function(s) {
var noSharedTooltip = s.noSharedTooltip && shared,
compareX = (!noSharedTooltip &&
s.options.findNearestPointBy.indexOf('y') < 0),
point = s.searchPoint.call(s.polar, e, compareX);
if ( // Check that we actually found a point on the series.
isObject(point, true) && point.series &&
// Use the new point if it is closer.
(!isObject(closest, true) ||
(sort(closest, point) > 0))) {
closest = point;
}
});
return closest;
};
}(Highcharts))
Demo:
https://jsfiddle.net/BlackLabel/8b2mhqf0/
I am developing a xamarin android app and I am using oxyplot to display a graph. This is the code of oxyplot
OxyPlot.Axes.CategoryAxis xaxis = new OxyPlot.Axes.CategoryAxis();
xaxis.Position = AxisPosition.Bottom;
xaxis.TextColor = OxyColors.Transparent;
xaxis.IsPanEnabled = false;
xaxis.IsAxisVisible = false;
xaxis.MinorTickSize = 0;
xaxis.MajorGridlineStyle = LineStyle.None;
xaxis.MinorGridlineStyle = LineStyle.None;
xaxis.IsZoomEnabled = false;
xaxis.IsPanEnabled = false;
LinearAxis yaxis = new LinearAxis();
yaxis.Position = AxisPosition.Left;
yaxis.TextColor = OxyColors.Transparent;
yaxis.IsPanEnabled = false;
yaxis.IsAxisVisible = false;
yaxis.MinorTickSize = 0;
yaxis.MajorGridlineStyle = LineStyle.None;
yaxis.MinorGridlineStyle = LineStyle.None;
yaxis.IsZoomEnabled = false;
yaxis.IsPanEnabled = false;
OxyPlot.Series.ColumnSeries s1 = new OxyPlot.Series.ColumnSeries();
//s1.IsStacked = true;
s1.Items.Add(new ColumnItem(100));
s1.Items.Add(new ColumnItem(55));
var model = new PlotModel();
model.Background = OxyColors.White;
model.PlotAreaBorderColor = OxyColors.Transparent;
model.Series.Add(s1);
model.IsLegendVisible = false;
return model;
And this is the output in my phone
The problem is that I wanna hide everything except the two bars. Hide the lines and the values of the axis. Thank you very much.
As said in the documentation:
If no axes are defined, linear axes will be added to the bottom and left.
You have not set these two axes to your model, so it adds two default axes.
You could try to use the following codes to add axes:
//...
//Your other code
//....
var model = new PlotModel();
model.Background = OxyColors.White;
model.PlotAreaBorderColor = OxyColors.Transparent;
//Add axes
model.Axes.Add(xaxis);
model.Axes.Add(yaxis);
model.Series.Add(s1);
model.IsLegendVisible = false;
I'm building an iOS app (unified) using Xamarin. I'm also using TeeCharts. I have a very simple bar chart whose bottom axis labels are rotated by 90 degrees (vertical labels). The bottom axis shows dates (10 days, starting from today). I've also set the date format to "MM/dd".
Here's my code:
private void CreateChartUI()
{
CGColor textColor = UIColor.Black.CGColor;
this.Chart.Aspect.View3D = false;
this.Chart.Header.Text = String.Empty;
this.Chart.Aspect.ZoomScrollStyle = Steema.TeeChart.Drawing.Aspect.ZoomScrollStyles.Manual;
this.Chart.Zoom.Active = false;
this.Chart.Zoom.Allow = false;
this.Chart.Panning.Allow = ScrollModes.None;
this.Chart.Legend.Visible = false;
this.Chart.Header.Text = "Test";
// Walls
this.Chart.Walls.Back.Pen.Visible = false;
this.Chart.Walls.Back.Gradient.Visible = false;
this.Chart.Walls.Back.Color = UIColor.Gray.CGColor;
// Left axis
this.Chart.Axes.Left.AxisPen.Visible = false;
this.Chart.Axes.Left.Grid.Visible = false;
this.Chart.Axes.Left.Ticks.Visible = false;
this.Chart.Axes.Left.MinorTicks.Visible = false;
this.Chart.Axes.Left.MinorGrid.Visible = false;
this.Chart.Axes.Left.Grid.Style = Steema.TeeChart.Drawing.DashStyle.Solid;
this.Chart.Axes.Left.Grid.Color = UIColor.White.CGColor;
this.Chart.Axes.Left.Grid.Width = 2;
this.Chart.Axes.Left.Labels.Font.Color = textColor;
this.Chart.Axes.Left.MaximumOffset = 30;
// Bottom axis
this.Chart.Axes.Bottom.AxisPen.Visible = false;
this.Chart.Axes.Bottom.Grid.Visible = false;
this.Chart.Axes.Bottom.Ticks.Visible = false;
this.Chart.Axes.Bottom.MinorTicks.Visible = false;
this.Chart.Axes.Bottom.MinorGrid.Visible = false;
this.Chart.Axes.Bottom.Grid.Visible = false;
this.Chart.Axes.Bottom.Labels.Angle = 90;
this.Chart.Axes.Bottom.Labels.Font.Color = textColor;
// series
Steema.TeeChart.Styles.Bar testSeries = new Steema.TeeChart.Styles.Bar() { VertAxis = Steema.TeeChart.Styles.VerticalAxis.Left };
testSeries.Marks.Visible = false;
testSeries.Color = UIColor.Blue.CGColor;
testSeries.XValues.DateTime = true;
testSeries.BarWidthPercent = 100 * (int) (float)UIKit.UIScreen.MainScreen.Scale;
testSeries.SideMargins = true;
this.Chart.Series.Add(testSeries);
}
The result is this:
As you can see, the labels of the bottom axis are cut off. I'm using the latest TeeChart version (4.15.1.19).
Any help would be appreciated.
yes, you're correct, it's a bug which has already been fixed. It will be included into the next maintenance release which will be availble at the Xamarin Store and also on our web site at the customers download page.
Thanks!
Josep
Hi I keep getting the error: expecting identifier before greater than.
on line 13.
Any help would be nice please and Thank you.
fly = function () {
this.animate = function() {
// Capture mouse positions and distance from mouse
this.targetX = _root._xmouse;
this.targetY = _root._ymouse;
this.distX = this.targetX-this.meX+this.flockX;
this.distY = this.targetY-this.meY+this.flockY;
//
if ((this.targetX == this.oldTargetX) && Math.random()>0.9) {
// add small scale random darting if mouse is still
this.flockX = (Math.random()*100)-50;
this.flockY = (Math.random()*100)-50;
} else if ((this.targetX<>this.oldTargetX) && Math.random()>0.8) {
// add large scale random darting if mouse is moving
this.flockX = (Math.random()*400)-200;
this.flockY = (Math.random()*400)-200;
}
// Apply inertia equation
this.meX = Math.round(this.meX+(this.distX)/20);
this.meY = Math.round(this.meY+(this.distY)/20);
// perform animation
this._x = this.meX;
this._y = this.meY;
// remember the current mouse pos so we can tell if
// it has moved next time around
this.oldTargetX = this.targetX;
};
this.initialize = function() {
this.targetX = 0;
this.targetY = 0;
this.distX = 0;
this.distY = 0;
this.meX = this._x;
this.meY = this._y;
this.oldTargetX = 0;
this.flockX = (Math.random()*200)-100;
this.flockY = (Math.random()*200)-100;
};
// set up onEnterFrame script to animate _parent...
this.initialize();
this.onEnterFrame = this.animate;
};
//
//
var i:Number = 0;
var bugClip:MovieClip;
for (i=0; i<30; i++) {
bugClip = this.attachMovie("bug", "bug"+i, i);
fly.apply(bugClip);
}
I don't know about Actionscript, but by looking at your code I would recomend doing like this:
randomValue = Math.random()
if ((this.targetX == this.oldTargetX) && randomValue>0.9) {
The <> operator for not equals has been deprecated since Flash Player 5 Doc reference here
You should use != for the same functionality.
Although i tested this on Flash Player 10.2 and it will still compile and run with no errors. I guess you are compiling to a later version.
I want a chart with transparent background, and therefore PNG seems a good choice. But when I set transparent background, the quality of the axis labels falls dramatically. How do I fix this? See the following code. As it stands, the chart has a transparent background, as I want, but the text quality is atrocious. If I comment out the two "Color.Transparent" settings, then the text quality is nice, but the background is not transparent.
How do I get transparency and nice text?
public static void Main(string[] args)
{
Chart c = new Chart();
c.TextAntiAliasingQuality = TextAntiAliasingQuality.High;
Series s = new Series("Series1");
c.Series.Clear();
c.Series.Add(s);
s.ChartType = SeriesChartType.Line;
s.Color = Color.Black;
ChartArea chartArea = new ChartArea("ChartArea1");
c.ChartAreas.Clear();
c.ChartAreas.Add(chartArea);
chartArea.BackColor = Color.FromArgb(255, 255, 255);
chartArea.BackSecondaryColor = Color.FromArgb(220, 220, 220);
chartArea.BackGradientStyle = GradientStyle.TopBottom;
chartArea.AxisX.LineColor = Color.Gray;
chartArea.AxisX.LineWidth = 2;
chartArea.AxisX.LineDashStyle = ChartDashStyle.Solid;
chartArea.AxisY.LineColor = Color.Gray;
chartArea.AxisY.LineWidth = 2;
chartArea.AxisY.LineDashStyle = ChartDashStyle.Solid;
chartArea.AxisX.MajorGrid.LineColor = Color.LightGray;
chartArea.AxisX.MajorGrid.LineDashStyle = ChartDashStyle.Dash;
chartArea.AxisY.MajorGrid.LineColor = Color.LightGray;
chartArea.AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dash;
c.BackColor = Color.Transparent;
chartArea.BackColor = Color.Transparent;
double[] x = new double[] { 1999, 2005 };
double[] y = new double[] { 3210, 13456 };
Axis ay = chartArea.AxisY;
ay.Maximum = 13456;
ay.Minimum = 3210;
Axis ax = chartArea.AxisX;
ax.Maximum = 2005;
ax.Minimum = 1999;
for (int i = 0; i < x.Length; i++)
{
double xvalue = x[i];
double yvalue = y[i];
s.Points.AddXY(xvalue, yvalue);
}
// Save chart-image to disk:
c.SaveImage("chartimage.png", ChartImageFormat.Png);
}
Set chart's AntiAliasing to AntiAliasingStyles.Graphics to disable the antialiasing on text.
Taken from this thread.
Maybe this help you
in your .aspx file where your chart code is, look for the asp:ChartArea tag. then add BackColor = "Transparent".
<asp:ChartArea Name="ChartArea1" BackColor="Transparent"
</asp:ChartArea>
Hope this help.
chart.TextAntiAliasingQuality = TextAntiAliasingQuality.SystemDefault;
I read this from here: http://forums.asp.net/p/1656335/4315304.aspx?Re%20Chart%20transparency%20and%20text%20quality