<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
span.moz-smiley-s6
        {mso-style-name:moz-smiley-s6;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-ZA" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hi, I had this problem some time ago and it was raised as a QGIS bug that needed fixing because if you set the style programmatically
 using the colour codes it just gives a black legend.  Not sure if it has been fixed yet – it appears to be a problem with all GIS and all geological maps.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Here is a style file using the colour codes with no legend<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">and another that was done manually be editing the style file in notepad++<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">It uses the typical Gauteng Geology map and its colours and I summarised the geology map to minimise the pain<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Maybe if you follow its logic you may be able to do one that suits your purpose<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Regards<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#F08920">Arthur Taute<br>
</span></b><span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#404040">Chief Technical Principal, Pavements and Toll Roads<br>
<b>M </b>+27 83 274 8885   <b>T </b>+27 12 481 3821</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"> qgis-za-user [mailto:qgis-za-user-bounces@lists.osgeo.org]
<b>On Behalf Of </b>Immo Blecher via qgis-za-user<br>
<b>Sent:</b> 17 July 2017 03:22 PM<br>
<b>To:</b> South Africa QGIS user group <qgis-za-user@lists.osgeo.org><br>
<b>Cc:</b> Immo Blecher <immo@blecher.co.za><br>
<b>Subject:</b> Re: [QGIS-ZA-user] QGIS Legend Problem<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Hi All,<o:p></o:p></p>
<p>Attached a much smaller ZIP file with Shapefiles <span class="moz-smiley-s6">:-[</span>. It has only a few polygons.<o:p></o:p></p>
<p>Regards<o:p></o:p></p>
<p>Immo<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 17/07/2017 14:45, Dean Ollis via qgis-za-user wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hi, Immo <br>
<br>
Could you send us a copy of the layer you are trying to render with a legend, or a clipped section of the layer? That will help with the testing...
<br>
<br>
Thanks <br>
<br>
Dean <br>
<br>
------------------------------------------------------------------ <br>
Dean Ollis <br>
Freshwater Research Centre <br>
Kommetjie, Cape Town <br>
CELL: 072 377 7006 <br>
<br>
-------- Original Message -------- <br>
Subject: Re: [QGIS-ZA-user] QGIS Legend Problem <br>
From: Immo Blecher via qgis-za-user <a href="mailto:qgis-za-user@lists.osgeo.org">
<qgis-za-user@lists.osgeo.org></a> <br>
To: South Africa QGIS user group <a href="mailto:qgis-za-user@lists.osgeo.org"><qgis-za-user@lists.osgeo.org></a>
<br>
Cc: Immo Blecher <a href="mailto:immob19@gmail.com"><immob19@gmail.com></a> <br>
Date: 17/07/2017 14:23 <br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><br>
Sorry Frank, I realised later that I did not send that info. Here it is: <br>
<br>
QGIS version <br>
<br>
     <br>
<br>
2.18.10 <br>
<br>
     <br>
<br>
QGIS code revision <br>
<br>
     <br>
<br>
59e0f78 <a href="https://github.com/qgis/QGIS/commit/59e0f78"><https://github.com/qgis/QGIS/commit/59e0f78></a>
<br>
<br>
Compiled against Qt <br>
<br>
     <br>
<br>
4.8.7 <br>
<br>
     <br>
<br>
Running against Qt <br>
<br>
     <br>
<br>
4.8.7 <br>
<br>
Compiled against GDAL/OGR <br>
<br>
     <br>
<br>
1.11.3 <br>
<br>
     <br>
<br>
Running against GDAL/OGR <br>
<br>
     <br>
<br>
1.11.3 <br>
<br>
Compiled against GEOS <br>
<br>
     <br>
<br>
3.5.0-CAPI-1.9.0 <br>
<br>
     <br>
<br>
Running against GEOS <br>
<br>
     <br>
<br>
3.5.0-CAPI-1.9.0 r4084 <br>
<br>
PostgreSQL Client Version <br>
<br>
     <br>
<br>
9.5.2 <br>
<br>
     <br>
<br>
SpatiaLite Version <br>
<br>
     <br>
<br>
4.3.0a <br>
<br>
QWT Version <br>
<br>
     <br>
<br>
5.2.3 <br>
<br>
     <br>
<br>
PROJ.4 Version <br>
<br>
     <br>
<br>
492 <br>
<br>
QScintilla2 Version <br>
<br>
     <br>
<br>
2.9.1 <br>
<br>
     <br>
     <br>
<br>
<br>
And I run it under Ubuntu 16.04 LTS <br>
<br>
Thanks <br>
Immo <br>
<br>
On 17/07/2017 14:19, Frank Sokolic via qgis-za-user wrote: <br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hi Immo, <br>
<br>
Which version of QGIS are you using? <br>
<br>
Frank. <br>
<br>
On 17/07/2017 09:48, Immo Blecher via qgis-za-user wrote: <br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><br>
Good Morning Everyone, <br>
<br>
I have a geology layer with a few columns, including the chronostratigraphic symbol, the rock type description and, importantly, a colour column (String type). The values stored in the colour column are the HTML hex values for the colour according to the 1
 : 1 000 000 simplified geological map of South Africa. <br>
<br>
When I open the layer and select the colour column for colouring the lithological units it works beautifully, but I do not get a legend for the composer. But if I set the Properties|Style to Categorized and then again select the colour from the Colour column
 in the table I also get the same nicely coloured map according to the colour column, an a Legend. But the Legend is wrong...it chooses random colours! What am I doing wrong? Is there a way to get a correct legend, also only showing the units which are actually
 on the map in the composer. I can set the colours manually to match the value in the colour field but that sort of defeats the purpose.
<br>
<br>
Thanks for your help so long, <br>
<br>
Immo <br>
<br>
-- <br>
<br>
*Immo F. Blecher**Street: */52 Lynedoch Eco Village, Lynedoch, 7603, South Africa //*Postal:*//52 Lynedoch Eco Village, Lynedoch, 7603, South Africa //*Cell:*///+27 83 272 6791 |*Fax: *+27 86 7363302 *Email:*_immo@blecher.co.za_
<a href="mailto:immo@blecher.co.za"><mailto:immo@blecher.co.za></a> | _immob19@gmail.com_
<a href="mailto:immob19@gmail.com"><mailto:immob19@gmail.com></a>| _immob@mymtnmail.co.za
<a href="mailto:immob@mymtnmail.co.za"><mailto:immob@mymtnmail.co.za></a> _*Internet:*_<a href="http://www.blecher.co.za/_">http://www.blecher.co.za/_</a>
<br>
<br>
<br>
<br>
<br>
_______________________________________________ <br>
qgis-za-user mailing list <br>
<a href="mailto:qgis-za-user@lists.osgeo.org">qgis-za-user@lists.osgeo.org</a> <br>
<a href="https://lists.osgeo.org/mailman/listinfo/qgis-za-user">https://lists.osgeo.org/mailman/listinfo/qgis-za-user</a>
<o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><br>
<br>
<br>
_______________________________________________ <br>
qgis-za-user mailing list <br>
<a href="mailto:qgis-za-user@lists.osgeo.org">qgis-za-user@lists.osgeo.org</a> <br>
<a href="https://lists.osgeo.org/mailman/listinfo/qgis-za-user">https://lists.osgeo.org/mailman/listinfo/qgis-za-user</a>
<o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><br>
-- <br>
<br>
*Immo F. Blecher**Street: */52 Lynedoch Eco Village, Lynedoch, 7603, South Africa //*Postal:*//52 Lynedoch Eco Village, Lynedoch, 7603, South Africa //*Cell:*///+27 83 272 6791 |*Fax: *+27 86 7363302 *Email:*_immo@blecher.co.za_
<a href="mailto:immo@blecher.co.za"><mailto:immo@blecher.co.za></a> | _immob19@gmail.com_
<a href="mailto:immob19@gmail.com"><mailto:immob19@gmail.com></a>| _immob@mymtnmail.co.za
<a href="mailto:immob@mymtnmail.co.za"><mailto:immob@mymtnmail.co.za></a> _*Internet:*_<a href="http://www.blecher.co.za/_">http://www.blecher.co.za/_</a>
<br>
<br>
Contact me: <a href="mailto:immob19@gmail.com">immob19@gmail.com</a> immoblecher <br>
<br>
<a href="http://www.linkedin.com/pub/immo-blecher/30/414/b8"><http://www.linkedin.com/pub/immo-blecher/30/414/b8></a>
<br>
<br>
     <br>
<br>
Please consider your environmental responsibility. Before printing this e-mail message, ask yourself whether you really need a hard copy.
<br>
<br>
IMPORTANT: The contents of this email and any attachments are confidential. They are intended for the named recipient(s) only. If you have received this email by mistake, please notify the sender immediately and do not disclose the contents to anyone or make
 copies thereof. <br>
<br>
<br>
<br>
_______________________________________________ <br>
qgis-za-user mailing list <br>
<a href="mailto:qgis-za-user@lists.osgeo.org">qgis-za-user@lists.osgeo.org</a> <br>
<a href="https://lists.osgeo.org/mailman/listinfo/qgis-za-user">https://lists.osgeo.org/mailman/listinfo/qgis-za-user</a>
<o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><br>
_______________________________________________ <br>
qgis-za-user mailing list <br>
<a href="mailto:qgis-za-user@lists.osgeo.org">qgis-za-user@lists.osgeo.org</a> <br>
<a href="https://lists.osgeo.org/mailman/listinfo/qgis-za-user">https://lists.osgeo.org/mailman/listinfo/qgis-za-user</a>
<o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<div>
<p><strong>Immo F. Blecher</strong><b><span style="color:gray"><br>
<strong>Street: </strong></span></b><em><span style="color:gray">52 Lynedoch Eco Village, Lynedoch, 7603, South Africa</span></em><i><span style="color:gray"><br>
</span></i><em><b><span style="color:gray;font-style:normal">Postal:</span></b></em><em><span style="color:gray"> 52 Lynedoch Eco Village, Lynedoch, 7603, South Africa</span></em><i><span style="color:gray"><br>
</span></i><em><b><span style="color:gray;font-style:normal">Cell:</span></b> </em>
<span style="color:gray">+27 83 272 6791 </span><span style="color:#FF6600">|</span><span style="color:#666666">
<b>Fax: </b></span><span style="color:gray">+27 86 7363302 <b>Email:</b> </span><a href="mailto:immo@blecher.co.za">immo@blecher.co.za</a>
<span style="color:#FF6600">| </span><a href="mailto:immob19@gmail.com">immob19@gmail.com</a><span style="color:blue">
</span><span style="color:#FF6600">| </span><u><span style="color:blue"><a href="mailto:immob@mymtnmail.co.za">immob@mymtnmail.co.za</a><br>
</span></u><b><span style="color:#666666">Internet:</span></b><span style="color:#666666">
</span><a href="http://www.blecher.co.za/">http://www.blecher.co.za/</a><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray">Contact me:
</span><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;border:solid windowtext 1.0pt;padding:0cm"><img border="0" width="16" height="16" style="width:.1666in;height:.1666in" id="_x0000_i1025" src="cid:image001.jpg@01D300A6.28FE6C50" alt="Image removed by sender." name="graphics2"></span><span style="font-size:7.5pt;font-family:"Verdana",sans-serif"><a href="mailto:immob19@gmail.com">immob19@gmail.com</a>
<span style="border:solid windowtext 1.0pt;padding:0cm"><img border="0" width="16" height="16" style="width:.1666in;height:.1666in" id="_x0000_i1026" src="cid:image001.jpg@01D300A6.28FE6C50" alt="Image removed by sender." name="graphics3"></span>immoblecher</span>
<o:p></o:p></p>
<div id="WISESTAMP_SIG_9425">
<div style="mso-element:para-border-div;border:none;border-top:solid #E5E5E5 1.0pt;padding:1.0pt 0cm 0cm 0cm">
<p style="margin-bottom:0cm;margin-bottom:.0001pt;border:none;padding:0cm"><a href="http://www.linkedin.com/pub/immo-blecher/30/414/b8"><span style="border:solid windowtext 1.0pt;padding:0cm;text-decoration:none"><img border="0" width="160" height="33" style="width:1.6666in;height:.3437in" id="_x0000_i1027" src="cid:image002.jpg@01D300A6.28FE6C50" alt="Image removed by sender." name="graphics4"></span></a><o:p></o:p></p>
</div>
<table class="MsoNormalTable" border="0" cellpadding="0" width="100%" style="width:100.0%">
<tbody>
<tr>
<td width="1%" valign="top" style="width:1.0%;padding:0cm 0cm 0cm 0cm">
<div style="mso-element:para-border-div;border:none;border-right:solid #E5E5E5 1.0pt;padding:0cm 4.0pt 0cm 0cm">
<p style="border:none;padding:0cm"><span style="border:solid windowtext 1.0pt;padding:0cm"><img border="0" width="32" height="32" style="width:.3333in;height:.3333in" id="_x0000_i1028" src="cid:image003.jpg@01D300A6.28FE6C50" alt="Image removed by sender." name="graphics5"></span><o:p></o:p></p>
</div>
</td>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<p>Please consider your environmental responsibility. Before printing this e-mail message, ask yourself whether you really need a hard copy.<o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<div style="mso-element:para-border-div;border:none;border-top:solid gray 1.0pt;padding:1.0pt 0cm 0cm 0cm">
<p style="margin-bottom:0cm;margin-bottom:.0001pt;border:none;padding:0cm"><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:gray">IMPORTANT: The contents of this email and any attachments are confidential. They are intended for the named
 recipient(s) only. If you have received this email by mistake, please notify the sender immediately and do not disclose the contents to anyone or make copies thereof.</span><o:p></o:p></p>
</div>
<p style="margin-bottom:0cm;margin-bottom:.0001pt"><span style="border:solid windowtext 1.0pt;padding:0cm"><img border="0" width="2" height="2" style="width:.0208in;height:.0208in" id="_x0000_i1029" src="cid:image004.jpg@01D300A6.28FE6C50" alt="Image removed by sender." name="graphics6"></span><o:p></o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><br>
_____________________________________________________________________ <br>
This e-mail has been scanned for viruses by Symantec.Cloud.<o:p></o:p></p>
</div>
</body>
</html>